How to track only horizontal speed!

Get help using Construct 2

Post » Sun Dec 04, 2011 6:34 am

Heyo! I'm new to Construct and I love it so far!

However, I've got a question...

I have an object with a Platform behavior. I'd like to make it so when the object has a horizontal speed below 0 (meaning it moves left) the sprite mirrors left. When the horizontal speed is above 0 (meaning it moves right) the sprite unmirrors to the right. I have the actions down just fine, but it seems the conditional for the object is just comparing it's SPEED, which also applies to itself vertically.

How do I track an objects HORIZONTAL speed?

Thanks in advance!
B
1
G
1
Posts: 1
Reputation: 527

Post » Sun Dec 04, 2011 8:34 am

New Condition > System > Compare 2 values > Object.Platform.VectorX
Image
B
225
S
27
G
13
Posts: 1,774
Reputation: 18,024

Post » Sun Dec 04, 2011 7:09 pm

This isn't normally done by the VectorX, usually it's done by keypresses instead:

+ On left pressed
-> Set mirrored

+ On right pressed
-> Set not mirrored
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Wed May 09, 2012 3:48 pm

@Ashley

Is there a problem with using the vectorX idea.
I have a problem with using the keys pressed technique, when pressing both it is possible to have the sprite walk backwards.

Regards Traeve
B
5
Posts: 15
Reputation: 957

Post » Wed May 09, 2012 3:53 pm

Yes, VectorX should work as well.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544


Return to How do I....?

Who is online

Users browsing this forum: Timedoor Indones and 30 guests