Actor rotate 360 degrees on center point
wolala123
Member Posts: 249
How do an actor rotate on center point? Thanks.
For example, a cannon rotate around center point with 360 degrees.
Comments
Reviving this thread, if someone knows the answer please post.
I want my moving hero to rotate once, 360 degrees around its centre point when space bar is pressed?
When Space is pressed
--Interpolate rotation to 360
Like this?
http://tinypic.com/r/k4z7f7/9
Still can't implement the control
Try maybe to rotate to + or -359.999, maybe GS thinks 0 and 360 is the same so it's not moving it... Not sure
Can you describe the steps you went through to create the rule - and any other additional rules for the actor that might be effecting it ?
Interpolate is simply changing one value to another through all the intermediate steps, so it wouldn't really make any difference whether the target value was 360 or even 1440.
This is how I would do it (demo attached):
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Here's the link:
http://tinypic.com/r/k4z7f7/9
Is this the way I should do it?
There is accelerate attributes on the actor as well, but does that affect it though?
No. That will interpolate the rotation TO 360°. Not THROUGH 360°, which is what you want. See my demo above.
Not sure what you're asking since you haven't explained what attributes and how you're accelerating the actor.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Awesome, thank you.
Oops... I made a slight error in the file. Forgot to store the starting rotation... one sec and I'll upload a new version.
Edit: Okay, my post above has the fixed file and updated screenshot.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
You can simply interpolate the rotation to 360 (or -360), you don't need the start rotation attribute.
Example attached:
I've seen that, I was asking if you could share the steps you went through to create the rule and any other rules the actor might have.
Looks to me like you created the 'rotation' attribute yourself ?
It works just fine ! Honestly !!
It really does work if you try it !
So I had to try it... and.... it works!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Yeeeaaahh ! At last a believer ! You will be rewarded for your faith, not in this life, but probably in 1.25.62
@Socks
It does work! But only if self.rotation starts at 0, right?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yes, it assumes a default starting angle of 0°, any other angle (or changing angles) and then I'd use your approach of a starting angle attribute.