how do you constrain that actor to follow another?
Comments
tenrdrmerMember, Sous Chef, Senior Sous-ChefPosts: 9,934
You said the keyword. "Constrain"
you would need to make some attributes to track the lead actor and then using the expression editor make your followers position be less than you leads position.
Oh so like self x to positionx. The same with y right?
tenrdrmerMember, Sous Chef, Senior Sous-ChefPosts: 9,934
You would just want to offest it
So lets say If self.motion Linear velocity.X is Greater than 0 Constrain self.position.x to game.leader.x-50
Theres lots of different ways to accomplish what you want. This a simple way but depending on what you are doing you will need to adapt it.
Another option would be Tracking the leader Speed and distance from the follower
you would do some thing like this in the follower
If game.distancefromLeader is > 50 -Constrain self.linearverlocity.x to game.leadervelocityX -Constrain self.linearverlocity.y to game.leadervelocityY
Lots of ways to do the same thing. You will just have to decide whats best for you. Definitly watch the videos too. Theres prob another way to do it in those.
Comments
you would need to make some attributes to track the lead actor and then using the expression editor make your followers position be less than you leads position.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
or whatver you want.
So lets say
If self.motion Linear velocity.X is Greater than 0
Constrain self.position.x to game.leader.x-50
Theres lots of different ways to accomplish what you want. This a simple way but depending on what you are doing you will need to adapt it.
Another option would be Tracking the leader Speed and distance from the follower
you would do some thing like this in the follower
If game.distancefromLeader is > 50
-Constrain self.linearverlocity.x to game.leadervelocityX
-Constrain self.linearverlocity.y to game.leadervelocityY
Lots of ways to do the same thing. You will just have to decide whats best for you. Definitly watch the videos too. Theres prob another way to do it in those.