But as shown, it relies on a pivot attached to the gameobject, which I don’t like.
How can I achieve the same without a pivot?
I already tried TransformPoint/InverseTransformPoint but never managed to get the same results.
That’s not really enough information to help you. TransformPoint/InverseTransformPoint are the way to change between local and global coordinates, so if those didn’t work, either you used them wrong (in code you haven’t shown), or the surrounding code (that you also haven’t shown) is relying on them being local in some other way. Either way, you haven’t shown the code with the actual problem.
Hi, thanks for replying.
There’s no problem here at all. My code works fine using a pivot, but I just want to optimise it and get rid of the extra gameobject, and learn another technique as well. My question is how I can transform the code I shown to an equivalent using TransformPoint/InverseTransformPoint. Maybe it can also be useful to other developers reading this to know both techniques.