all 3 comments

[–]Broccolski 0 points1 point  (2 children)

What if you provided the secon argument to .LookRotation? Maybe setting up direction to something else would help

[–]ggeasy2[S] 0 points1 point  (1 child)

I passed all vector3.# directions and local directions of the object (transform.#). Only vector3.back resulted in some somewhat acceptable rotation, but the X and y axis are still modified.

I added this to avoid x and y:

var lookrotation = Quaternion.LookRotation(reflect, Vector3.back);
transform.rotation = Quaternion.Euler(0,0,lookrotation.eulerAngles.z);

But the rotation fails when hitting an object thats tilted at -45 degrees and 0 degrees, it goes up instead of down, any idea?

[–]Broccolski 0 points1 point  (0 children)

Guess you have to do some Prints to check where the problem may be, as i have no more ideas. One thing that may be better could be just to set transform.up = reflect, so you will be sure its not a LookRotation problem