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.
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
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.