center point of rotation?

3absh3absh Member Posts: 601

i have a light in the game that I'm trying to make rotate from a different center point than the middle.


How can i make the center point at the bottom so when i change the rotation of this actor it will rotate around the bottom not the middle?

Comments

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    You can use Center of Mass, located under the Movement attributes for the actor. If your image were 100 pixels tall, you would offset the Y COM by about -45 or so. Just FYI, this won't work in the online editor and I don't believe COM is supported in HTML 5 output.


  • 3absh3absh Member Posts: 601

    >You can use Center of Mass

    I tried this approach, it doesn't work

  • 3absh3absh Member Posts: 601

    This seems like a very basic function, I spent the whole day trying to make this work through different math formulas and I still can't do it.

    @adent42

  • 3absh3absh Member Posts: 601

    Center of mass I believe is only for when rotation is through velocity.


    I'm using interpolate rotation.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited May 2020

    It doesn't appear to work with Interpolate, but it does work if you use the Rotate Behavior.

    A work around would be to create an image that is twice the size you need, with one half being empty/transparent so the center of the full image is actually where you have the light source starting from.

  • 3absh3absh Member Posts: 601

    it's working, thanks @jamie_c

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    @3absh, great, glad to hear it! :)

Sign In or Register to comment.