Moving my enemy
doug_smuppet
Member Posts: 99
I created my actor (enemy) and would like to put a move on him, I wish he walked, for example, from x = 100 to x = 300 and x = 300 to x = 100 in loop.
how can I do that?
how can I do that?
Comments
Create a rule:
When attribute self.Position.X = 100,
Interpolate self.position.x to 300
New rule
When attribute self.position.x = 300,
Interpolate self.position.x to 100
Or,
Create a real self attribute - call it start.x
Constrain attribute self.position.x to sin(self.Time*100)*100+self.start.x
You might need to tweak the "100" which is outside the parenthesis - this tells the actor how far to move.
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
*I have windows version.
AAA*sin(self.Time*BBB)+CCC
AAA = how far you want your actor to move in each (left and right) direction.
BBB = the speed of movement.
CCC = the centre point of its movement.
So for 100 to 300 it would be: 100*sin(self.Time*100)+200
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx