how do i attach an actor to another actor?
Adamgopro
Member Posts: 310
how can i make an actor stay on top of the postion of my moving actor? or stay within a certain position of an actor thats moving?
Comments
your_actor_1_leading
your_actor_2_following
You need 2 Scene Attributes (Both Real)
your_actor_x
your_actor_y
In the actor that you want to lead, you will need a constrain behavior
constrain (scene.your_actor_x) to (self.position.x)
constrain (scene.your_actor_y) to (self.position.y)
In the actor you want to follow you will also need a constrain behavior
constrain (self.position.x) to (scene.your_actor_x)
constrain (self.position.y) to (scene.your_actor_y)
That's it.
Make two game attributes:
MasterPosition X
MasterPosition Y
In actor 1 place two constrain behaviours:
Constrain MasterPosition X to self position X
Constrain MasterPosition Y to self position Y
In actor 2 place two constrain behaviours:
Constrain self position X to MasterPosition X
Constrain self position Y to MasterPosition Y
socks had a feeling you was going to be quick on the scene at answering this haha!
Not quick enough ! 8-X
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
or whatever number you want it lowered by.
[shakes fist at sky] /insert sound FX: Thunder. 8-X
Here's some constrain stuff I coincidently posted yesterday in the 'spare code' thread: (there's an offset just like you want in there)
http://www.mediafire.com/?9fld3cme7oc7d3o
) You have no idea how many times I have played out that joke here at work. Ahhhhh sweet childish humor...how I love thee.