Ivan3z
(Ivan3z)
1
I have this material that orients the mesh to the camera.
Works great if the actor is not moving.
But if the actor rotate it no longer looks at the camera.
So I think if I subtract the actor rotation (its own rotation) the mesh will be always looking at the camera.
I know I can do this if I modify the rotation from the actor using dynamic materials instances.
In fact that’s what I’ve been doing so far.
But what I’m looking for is to do everything from the material code.
Does anyone know how I can compensate the actor’s rotation from the material code?
Thank you so much!!
EDITED:
i found this code
in this publication
However seems it does not work…
Seems it return zero, because i substract its result a nothing changed…
I still need help with this…
Thank you!!
Nawrot
(Nawrot)
2
I think you would like this:
There is material that you are trying to make. It also explain how to check for vectors.
1 Like
Ivan3z
(Ivan3z)
3
Thank you so much!!
Thanks to that video I have managed to compensate the rotations… now it always looks at the camera.
However, the mesh was rotated 90 degrees with respect to the original position.
It is now perpendicular to the desired position.
But it is definitely a great step forward.
I just need it to stay in the correct rotation.
This is the code I have at the moment:
It should be in a horizontal position
Any suggestions for changes are welcome.
Thank you so much!!
Ivan3z
(Ivan3z)
4
Well… I got it
I think it will take me 1000 years to understand that thing about camera points of view.
But after 10 minutes of testing I managed to get it to work.
Thank you very much for your help 
I leave this information here in case someone wants to do the same with a horizontal mesh.
1 Like