I’m trying to make rotation in one object , using one point as reference. I would that the forward from my object is always the point of reference . Here is the code that i’m trying to make it work.
The first parameter of LookRotation needs to be a direction, not a position. You need to calculate the forward direction that you want. In this case, I’m guessing it should be:
Basically, to get the direction, you just need to subtract the object’s position from the target’s position to get a vector. Then normalize that vector.
Edit: For the purpose of LookRotation, I don’t know whether it needs to be normalized to work.
No, it does not need to be normalized. Though it doesn’t really hurt on modern hardware ^^. In many cases you need the normalized direction for other things anyways.
I believe it needs normalising if you want to compare the desired forward vector with the current forward vector. However if you are merely setting the forward vector to = -(positionA - positionB) it will result the correct direction.