For my current project, I would like to do an action depending on the Linear Velocity of an object. I am using var howfast = object.physicsImpostor.getLinearVelocity(); console.log(howfast); so I can see how fast it is going.
Is there any way to use an if-else statement with the variable howfast? Like if (howfast > 9001) console.log("It's over nine thousand!"); Pardon the dead meme.
I think you mostly answered your own question? getLinearVelocity returns a Vector3, so maybe you are actually asking how to go from a Vector3 to a number? If so, Vector3.length might be the answer you are looking for?
Or, perhaps you were wondering how to do this check all the time? If that is the case you could try the registerBeforePhysicsStep
I recommend reading the docs for the tools you are using to see what all is possible.