center point of rotation?
3absh
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
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.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
>You can use Center of Mass
I tried this approach, it doesn't work
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
Center of mass I believe is only for when rotation is through velocity.
I'm using interpolate rotation.
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.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
it's working, thanks @jamie_c
@3absh, great, glad to hear it! :)
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page