Off-Centre Pivot Point
This is another question that comes up from time to time, how to rotate your actor around a point other than its own centre . . . I know it's been addressed in the past (for example RThurman did a great demo a while back), but I thought it would be useful to have a fully interactive project, where you could simply move the pivot point to where you need it to be.
GS project attached.
You can move the actor and/or the pivot point, change the size of the actor, the actor's rotation and so on . . . and it will always rotate around the pivot point.
It should be fairly straightforward to copy this system into your own project as there are only two actors, the pivot point passes its X and Y to the main actor via two game.attributes, so pretty easy to set up.
Comments
The three constrain behaviours in the main actor are what make it rotate.
At the moment they all just use the game clock as an incrementing value (which keeps it spinning), but you can use whatever you like to control the rotation - you just need to replace the 'game.time *100' part in each of the three constrain behaviours with - for example - an attribute that increases when you press right and decreases when you press left . . . or - for example - you could have a value that is being interpolated up and then down to have the actor rotate back and forward . . .
Thanks! Bookmarked.
Great stuff! Thanks for sharing!
Contact me for custom work - Expert GS developer with 15 years of GS experience - Skype: armelline.support
Must...not...give...awesome...
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Thanks for sharing
✮ FREE TEMPLATES, ANIMATIONS ✮ ✮ GAME PRO MARKET BUY & SELL ✮
Cheers
By the way, you can have multiple actors all using the same pivot point, no need to modify anything, just drag some extra actors into the scene, so it kind of acts like an interactive constrain system as well (although Fast Constrain might be better for that kind of thing - https://forums.gamesalad.com/discussion/75220/fast-constrain-linkmachine-v2 ).
Is it possible to have the actor begin to pivot after a rule is complete? I've noticed that since its controlled by game.time the actor doesn't begin to rotate from its current position. The actor jumps depending on game.time.
Found it!
.
@Socks great job man and thanks for sharing
@Socks something I was waiting for as a gamesalad feature, but you just did it haha. Amazing job, THANKS!!
Nice!
A special treat for @Socks in line with this project:
Lump Apps and My Assets
Very nice!
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Nice and concise!
MESSAGING, X-PLATFORM LEADERBOARDS, OFFLINE-TIMER, ANALYTICS and BACK-END CONTROL for your GameSalad projects
www.APPFORMATIVE.com
Nice demo!
Cheers !!
@Socks Your video (on all discusions) don't seem to be working, so I have no idea what you mean in the screenshot by Self.M and Self.SA. Plus, what is that Self. on the end? Thanks in advance Socks!
(Like my "emoji"?) ^
Self.M = Magnitude
Self.SA = Self Angle
Self. on the end = Self.A (vector angle actor / pivot)