Lock Actors together
Tomaff
Member Posts: 8
I have a car in profile at the moment. However as it is driving if the car rotates how do i get the wheels which are seperate actors to rotate with it?
Comments
and possibly this one:
http://gamesalad.com/wiki/how_tos:gsc_circular_movement
e.g. Constrain Attribute: self.Position.X = game.carX + 12
This won't work well if you are rotating the car but that's where the second how to may help.
Thanks for your help.
Make a game attribute called something like WheelRot, then go into your wheel actor and add a constrain attribute behavior that constrains game.WheelRot to self.Rotation (or whatever it's called). Next, go into your car-body actor and add a constrain attribute behavior to it which constrains game.WheelRot to self.Rotation.
... I haven't tried this but it should work... I think. Maybe I will go try this now before starting papers for my midterm :P Games come first you know.
EDIT: Tested it and it works.
The Actors
http://i3.photobucket.com/albums/y58/MattVG/Game Stuff/Picture2.png
The game attributes
http://i3.photobucket.com/albums/y58/MattVG/Game Stuff/Picture3.png
The Wheel behavior
http://i3.photobucket.com/albums/y58/MattVG/Game Stuff/Picture4.png
The CarBody behaviors
http://i3.photobucket.com/albums/y58/MattVG/Game Stuff/Picture5.png
I hope that helps.
So this is what i am trying to achieve. Sorry for the drawing. Actor 1 has to be able to rotate 360. Which is simple enough. The only trouble is that i cannot get actors 2 and 3 to lock themselves in the same position relative to actor 1 while actor 1 rotates. Actors 2 and 3 will also need to rotate themselves on their central axis.