hitPosition - hit point of the ray collision

Hello everyone.

ray.hitPosition - gives the coordinates of the object, but is there a way to get the coordinates of the point of contact of the ray?

Thank you for attention.

ray.hitPosition DOES give you point of contact of the ray. If you want coordinates of the object, use ray.hitObject.worldPosition

  • You’re right, ray.hitPoshition - coordinates of point of contact of the ray.

I just got there so:


hitObj01 = ray.hitObject
pos = hitObj01.worldPosition

and then added - hitObj02 = ray.hitPosition, but forgot to change the pos = hitObj02


hitObj01 = ray.hitObject
hitObj02 = ray.hitPosition
pos = hitObj01.worldPosition #error

example - hitPositionTEST.blend (513 KB)

Thank you for help.