use mouse to control actor
scitunes
Member, Sous Chef Posts: 4,047
I am trying to control an actor by having the actor accelerate toward mouse.position.x
It only seems to start accelerating when I drag the mouse WAY over to the right or WAY over to the left (well off the 480x320 scree).
Anybody have any ideas about what I am doing wrong?
It only seems to start accelerating when I drag the mouse WAY over to the right or WAY over to the left (well off the 480x320 scree).
Anybody have any ideas about what I am doing wrong?
Comments
Constrain Attribute [self.Motion.Linear Velocity.X] to [game.Mouse.Position.X - self.Position.X]
Constrain Attribute [self.Motion.Linear Velocity.Y] to [game.Mouse.Position.Y - self.Position.Y]
This causes the actor to always move toward the mouse, more quickly if the mouse is far away and more slowly if it's close.