# Vector Y speed

Get help using Construct 2

### » Fri May 06, 2016 8:51 am

Quick question! I want to have a thing in my platformer that when the player lands on a particular surface it launches him violently away. I've got the effect I want working already by temporarily deactivating the controls for 0.5 seconds, simulating control for the opposite direction the player is facing, and setting Vector Y to -1000. Great! The player lands on it and is sent flying upwards.

What I'd like to know is, is there a way to change the speed at which the player is launched away? At the moment it is basically at the speed of a regular jump except super high, and tinkering with the options (setting platform behavior speed and jump strength etc) I can't quite get it exactly right. I want the player to get launched super-fast, as though out of a cannon. Can I do this with Vector Y, and if so how?

Coming soon on Steam!
B
16
S
9
G
3
Posts: 209
Reputation: 3,476

### » Fri May 06, 2016 4:08 pm

Vector Y is simply the vertical speed. When the player jumps, the game is setting the Vector Y to the value of "Jump Height" * -1 (you can see that if you run debug mode and look at the player's Platformer values
)
So you can easily do a "Set Vector Y to (a negative value)" and it works just like a jump with whatever strength you want
B
87
S
22
G
15
Posts: 1,041
Reputation: 15,353

### » Fri May 06, 2016 6:58 pm

Hmm. I realised after I made my earlier post that I got it a bit wrong. Let me rephrase: I want the player go very fast, but not very far. If I set Vector Y to something modest, say -500 or -1000, they travel the right distance but not fast enough. If I set Vector Y to something stupid, -9000, they go off at the speed of light but also travel waaay too far! I want a platform jump effect that takes the player very fast over a SHORT distance.

Coming soon on Steam!
B
16
S
9
G
3
Posts: 209
Reputation: 3,476

### » Fri May 06, 2016 7:09 pm

So basically you want a motion that is NOT natural physics.

You'll need an additional event to artificially cut the momentum of the object, either by comparing the distance travelled, time since launch, or height position, up to you.

Edit: Or make an invisible solid ceiling for your sprite to bonk its head into.
Last edited by oosyrag on Sat May 07, 2016 1:06 am, edited 1 time in total.
B
60
S
30
G
133
Posts: 1,942
Reputation: 74,861

### » Sat May 07, 2016 12:29 am

Ahhh, okay! Thanks, I'll give that a try tomorrow.

Coming soon on Steam!
B
16
S
9
G
3
Posts: 209
Reputation: 3,476