[Solved] Object Rotation
RCT_Games
Member, PRO Posts: 97
I want to make a object rotate as if it was spinning and coming at the actor, but I can't figure out how to make my object rotate on the center point. It keeps rotating from the bottom of my actor. The object that I am using is a taller object so I think thats why i'm having these issues.
I tried setting my center mass to the center point on my object, but so far nothing I do is working.
Currently I having a move set so the actor moves across the screen and theres a rotate.
Thanks!
Comments
An actor rotates from its centre by default, you shouldn't have to change anything.
What happened when you change the COM ?
I'm guessing your image is not symmetrical. The center of your image does not equal center of the object?
Center point is x = 0 y = 0. From an actors center of zero the number is negative going up and positive going down. So an actor 50x50 from middle to top is 0 throu -25. Middle to bottom is 0 throu 25. On the X the center to left is negative and center to right is positive.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
@Socks When I change it nothing seems to happen?
@gattoman Thats correct my actor is 50 X 87
I forgot to say that I have a custom Collision shape on, could that be the problem?
@Socks @Lost_Oasis_Games @gattoman
I figured it out. When I used PhysicsEditor to make my collision shape I moved the anchor point from 00 and doing that messed up the gamesalad anchor point. I made a new collision shape and did not move the point and now it's working correctly.
Thanks for the help!
As has been mentioned, actors rotate from their center point. This is true regardless of their image (an actor doesn't have any way of knowing what its image looks like... it could be a white square or a unicorn).
The image on the left is a poorly cropped image in Photoshop. The image on the right is the actor in GameSalad. You can see the center point (the point of rotation) in the exact center of the actor, unrelated to the image of the hammer. That actor is not going to rotate around the center point of the hammer.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Glad you found a solution.