[SOLVED] CS code vs JS question

My question is, am I converting this code correctly from CS to JS?

cs: Vector3 extra = Vector3.up * (Physics.gravity.y * gravityScale) * (fallMultiplier - 1) * Time.deltaTime;

JS: var extra = pc.Vec3.UP.clone().mulScalar(this.app.systems.rigidbody.gravity.y * this.gravityScale).clone().mulScalar(this.fallMultiplier- 1).mulScalar(dt);

Hi @Aaron_B,

Are you getting any error? The code seems correct, given the properties/variables that you use are valid numbers.

The only thing I’d fix is remove the second clone() call, it’s not really required.

1 Like


Was a logic error, code worked fine. Thank you Leonidas for checking!

1 Like