Glue actor to another actor?
izzydogham
Member Posts: 24
I've been attempting to glue an actor to a rotating ball actor for a long time. Nothing seems to work, i even tried constraining the rotation attribute to both actors and the ball didn't even rotate? Is there an actual method to do what I'm trying to accomplish? Essentially i want to pin down an actor on to another actor so one actor is static and one is dynamic. So for example like a spinning ball that constantly spins and when i click on the mouse the the other actor collides with the rotating ball and "sticks to the ball" Any help is appreciated! Please let me know if you need further elaboration as to what i'm trying to accomplish because it seems no one has answered this question fully on the forums so it would be beneficial for everyone.
Comments
http://forums.gamesalad.com/discussion/58521/how-to-get-actor-to-move-to-another-actor
This might also help
http://forums.gamesalad.com/discussion/57925/actor-rotating-issue#latest
Need Help? Email Me | Templates | Full Game Source Code
When Overlaps or Collides:
Constrain attribute Game.Rotation to self.rotation
Then in the one to constrain:
Constrain attribute self.rotation to Game.Rotation
Need Help? Email Me | Templates | Full Game Source Code
So when your actor(B) is not colliding, the attribute Gravity is set to 1.
Then you have a rule that contains all the movement for the actor(B) and only works when at attribute Gravity is set to 1.
When the actor(B) collides with the actor(A) it needs to stick to - you change the attribute Gravity to 0.
This means the actor(B) is now static and not getting the movement rule.
You can back that up by using attributes to then stop it or slow it down.
You then state in your rule that you constrain the self.Position.X and self.Position.Y and self.Rotation of actor(B) to match the other actor(A) who controls this actor.
You need to have attributes for actor(A) constrained to each bit of data you need - sounds like self.Position.X, self.Position.Y, self.Rotation, is what you need to constrain to actorX, actorY, actorRotate. All real attributes.
I hope this is clear enough and helps!
It has smoothed that problem out for me.
https://us.v-cdn.net/5017598/uploads/FileUpload/a7/f593e5194687beb984dcce6eb60ee4.zip
Sounds to me like what you your wanting to do is kinda like the game mechanic in A Long Way Home by @jonmulchay If so Your gonna need a math wiz to help you out with some complicated Trig Expressions.
Good Luck
@matarua thats hilarious