I have an actor moving on the ground, and every time when he comes to a certain position (x-pos) I want another actor to accelerate or move towards him. So I made 2 attributes playersx and playersx and went into my first actor which moves on the ground, there I said constrain attribute. In my actor that gets accelerated I created also an attribute called distance.
In the accelerated actor I said this
Constrain attribute distance to magnitude (self.pos.x - playersx, self.pos.y-playersy)
And finally I said:
When distance < 120 Accelerate or Move to, at this point I want the actor to get accelerated to the x position of the ground actor but if possible with constant speed!
Insert 'Change velocity' behaviour (to what ever speed) For direction click the 'e' and insert the constrained x of the player Make sure its relative to scene and not actor
Use this same behaviour but pointing at the constrained y as well if needed.
Comments
up everythigng with magnitude...
And if I use change velocity to other players x I cant set speed!
I worked with Magnitude.
And then I said: When distance < ....
accelerate
You understand?
I have an actor moving on the ground, and every time when he comes to a certain
position (x-pos) I want another actor to accelerate or move towards him. So I made 2 attributes playersx and playersx and went into my first actor which moves on the ground, there I said constrain attribute. In my actor that gets accelerated I created also an attribute called distance.
In the accelerated actor I said this
Constrain attribute distance to magnitude (self.pos.x - playersx, self.pos.y-playersy)
And finally I said:
When distance < 120
Accelerate or Move to, at this point I want the actor to get accelerated to the x position of the ground actor but if possible with constant speed!
thx
When distance <120
Insert 'Change velocity' behaviour (to what ever speed)
For direction click the 'e' and insert the constrained x of the player
Make sure its relative to scene and not actor
Use this same behaviour but pointing at the constrained y as well if needed.
That will then move at a constant speed as needed