Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the 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.
Post Reply
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: 22

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

Post Reply