Actor follow actor
illusion
Member Posts: 4
Hi,
I'm not quite sure on how to get an actor to follow another actor.. so for example say I have an actor (player) and a shopping trolley.. now the player walks around as normal, but soon as he bumps into the trolley it sticks to him until he pushes a button to release it.
How would I go about doing something like this?
Thanks
Illusion
I'm not quite sure on how to get an actor to follow another actor.. so for example say I have an actor (player) and a shopping trolley.. now the player walks around as normal, but soon as he bumps into the trolley it sticks to him until he pushes a button to release it.
How would I go about doing something like this?
Thanks
Illusion
Comments
Follow = true
If Follow = true
Constrain Cart.Position.X to Player.Position.X + 50 (or whatever offset you want to use, otherwise the cart will be on top of the player.
Constrain Cart.Position.Y to Plaster.Position.Y + 50
If Button is pressed
Follow = False
Simple as pie!
The constrain player x, y to them
Make an attribute Boolean push
On the cart make rule on cart that if collide if collide with play change attribute push to true otherwise false
Another rule if push true constrain cart x,y to attribute x,y plus any offsets you need for correct position
The on player make rule if push button change oust to false
Illusion