Vector Y speed

Get help using Construct 2

Post » 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?
Image



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

Post » 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
84
S
22
G
15
Posts: 1,039
Reputation: 15,249

Post » 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.
Image



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

Post » 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.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,699
Reputation: 64,446

Post » Sat May 07, 2016 12:29 am

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



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


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests