Vecotr3.Distance returns [object, object]

Hi!

I’m trying to implement rocket jumping into NYNS. The goal was to find the distance between the picked point and the player, then add the the distances to the player’s velocity.

Here is my playground: https://playground.babylonjs.com/#LPX1FM#34

At lines 269-280 are where the issue is. I try to find the distance between the picked point and the player at line 274. I have an alert pop up with the distance, but it says [object, object].

Any ideas?

Hi,

Just remove the new keyword from showa, since it is a function that returns a number, it’s not a new class or vector or anything

1 Like

pikachu%20oh Thanks!

2 Likes