This forum is locked and will eventually go offline. If you have feedback to share you can find us in our Discord channel "MythoLogic Interactive" https://discord.gg/nECKnbT7gk

Forum rules

How to make an object jump?

Here you can find answered ScriptAPI topics.
Forum rules
By using the forum you agree to the following rules.
Locked
User avatar
Ol1vver
Superfighter
Superfighter
Posts: 69
Joined: Mon Nov 19, 2018 4:55 pm
SFD Account: olv
SFD Alias: olv
Started SFD: PreAlpha 1.6.4
Gender:

How to make an object jump?

Post by Ol1vver » Mon Dec 31, 2018 2:41 pm

Hello,
Is there any possible way to make an object jump?
Example:
There is a crate on the map.
When you activate something, the crate jumps up, like a normal player, while still keeping it's physics (able to move, etc).
0 x

User avatar
ebomb09
Fighter
Fighter
Posts: 13
Joined: Mon Apr 30, 2018 5:04 am
SFD Account: ebomb09
Location: Canada/BC
Age: 24

Post by ebomb09 » Tue Jan 01, 2019 1:10 am

'SetLinearVelocity()' function if you can use the Script Editor
0 x

User avatar
Ol1vver
Superfighter
Superfighter
Posts: 69
Joined: Mon Nov 19, 2018 4:55 pm
SFD Account: olv
SFD Alias: olv
Started SFD: PreAlpha 1.6.4
Gender:

Post by Ol1vver » Tue Jan 01, 2019 2:53 pm

ebomb09 wrote:
Tue Jan 01, 2019 1:10 am
'SetLinearVelocity()' function if you can use the Script Editor
I don't understand what to type in, though.

I realised.
I had to use "[object].SetLinearVelocity(new Vector2([l/-r],[u/-d]))". (l - left, -r - right, u - up, -d - down)
Thanks!
1 x

Locked