**Help Constraining Actors**
![Mikv616](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
Hi I wanted to know how exactly do I constrain the position of a actor by using the position of another constantly moving actor thanks!
Best Answer
-
gyroscope I am here.Posts: 6,598
Hi @Mikv616
I'll answer with an example: constantly moving actor's starting x,y is 200,150, and the actor to follow is 300,100, let's say.
use 2 Constrain Behaviours as follows:
Constrain Attribute FollowActor.Position.x to MovingActor.Position.x + 100
Constrain Attribute FollowActor.Position.y to MovingActor.Position.x -50
If you wanted it to follow exactly, then don't put any offsets.
Hope that helps.""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Answers
Yes, the +100 and -50 as examples are the offsets; the position.X and position.Y for both actors – leading and following – are already there in their attributes, you don't have to make them.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I responded to your PM about this too, hope you get it worked out.
Jamie
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page