I have calculated a direction vector that I am assigning to transform.up.
I have a boat floating in waves. In the boat I have placed 3 empties in a triangle and displaced them with the wave function. From the three empties I have an X vector, a Z vector and a normal Y vector.
If I set transform.up = myVectorY I get exactly the motion of the wave but I am no longer able to turn the boat on the Y axis.
If I use transform.forward = myVectorX I can steer the boat and mimic the X rotation in the waves - but I lose the side to side Z motion.
Thanks for the suggestion but I’m not sure how rotating in world space vs object space would solve the problem. Can you elaborate on how I could transform my normalized Vector3 into Euler angles?
ooooo now that is a pretty demo, very nice. Just to be clear… is it the steering of the ship left/right, or the reaction of the ship to side on waves (bottom left slider fully right) that is causing the issue? (fairly sure I’m out of my league here, but I’ve got my thinking cap on )
It was the reaction of the ship side to side that wasn’t shown in the demo. I called that my Z axis rotation.
I now have everything working! Yeah! It only took me the entire day I am out of my league for sure. I was even watching youtube vids on Quaternions for a bit - that’s how desperate I was.
The solution involved applying the calculated UP vector to the transform (XZ) and rotating Y in a child. Then I translated the transform using the angles of the rotated child to determine the offset in X and Z.
Guaranteed there is a 2 line solution to this work around that took me hours to figure out. I’m just happy to finally have it working