How do I set my player to move slow

Get help using Construct 2

Post » Mon Jul 06, 2015 3:44 am

Hello Everyone,

I figured out how to move my player toward the cursor w/o rotating the player by using the 'Set Position'

but how do I control the speed for the player to get to the cursor.

Right now its pretty fast and I want it slow down.

Thank You.
B
24
S
4
Posts: 78
Reputation: 1,308

Post » Mon Jul 06, 2015 7:31 am

If you're using "set position" you can try set position to:

X: lerp(Self.X, Mouse.X, 0.03)
Y: lerp(Self.X, Mouse.X, 0.03)

Reducing or increasing the last value vill change the speed. That will make the speed slower/smooth.

Otherwize I would use Move object at angle, for more control.

Move object at angle.
Angle: angle(object.x, object.y, mouse.x, mouse.y)
speed: 3 ?
Follow my progress on Twitter
or in this thread Archer Devlog
B
38
S
15
G
17
Posts: 949
Reputation: 12,320

Post » Mon Jul 06, 2015 11:42 am

Right now it sounds like you are teleporting to the position. Set position does just that.

Try to play around with behaviors click the object in question and look for the behavior link scroll down to find movements.

Once you add one that best fits you can set default movements. Then you can play around with changing speeds and stuff for sprinting and such.
B
8
Posts: 23
Reputation: 360

Post » Mon Jul 06, 2015 2:50 pm

So I am using the Set Position for the player travels and it works great.

I'm wondering how come when the cursor is outside of layer either left or right the player will move inside the layout but it doesn't work when the cursor is out of layer at the bottom..the player would stay in place if I scroll left or right at the bottom.

Thank You.
B
24
S
4
Posts: 78
Reputation: 1,308


Return to How do I....?

Who is online

Users browsing this forum: jorgmaquoi, SignalOne and 18 guests