Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
locking vertical orientation/alignment
#1
Hi,

I tried all the orientation options but am struggling to find the right setting.

I have a flying machine following a spline, and I want it to align with the spline
tangent in the x z plane, but I need to lock the y orientation.

I hope that's straightforward ?

Thanks,
Ben
Reply
#2
Hi
Right now controllers can't follow a path only on specific translation/rotation dimensions. That's a feature that I am planning to include in the next major update. Until then, you can implement a solution to your specific use case by inheriting from the Spline Controller class. Override the ComputeTargetPositionAndRotation method by making sure the computed up vector is ignored and replaced by the locked y direction you want. Do you see what I mean?
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#3
(02-17-2021, 11:05 AM)_Aka_ Wrote: Hi
Right now controllers can't follow a path only on specific translation/rotation dimensions. That's a feature that I am planning to include in the next major update. Until then, you can implement a solution to your specific use case by inheriting from the Spline Controller class. Override the ComputeTargetPositionAndRotation method by making sure the computed up vector is ignored and replaced by the locked y direction you want. Do you see what I mean?


Thank you for your reply !

I just had a look into the controller script, and found it starting at line 537 -
but I am pretty new to coding so might take me a while to find the 
lines that I would have to change and how, but will try.

The reason for wanting to constrain the vertical orientation is that the machine takes off quite steeply, 
which tilts it and is a bit uncomfortable when you are inside in VR!

Regards, 
Ben
Reply
#4
if you are struggling with it, let me know and I will send you the modified code soon
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#5
Would this lock any child objects from rotating? I'm having an issue with a splinecontroller where the player cannot rotate cameras tied to child gameobjects.
Reply
#6
The controllers update every frame the position and rotation of the transform having the controller's component, it does not overwrite the transform of children.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#7
Hmm ok. Perhaps there is some conflict with the cinemachine vcam on my child object. The strange thing is i can rotate the child on the z axis but not on the y.
Reply
#8
Maybe. To rule out any influence of Curvy's controllers, go to \Curvy\Controllers\CurvyController.cs, then at around line 709 (depending on your version), in the method called InitializedApplyDeltaTime, comment the following lines:
cachedTransform.rotation = Quaternion.LookRotation(postDampingForward, postDampingUp);
cachedTransform.position = newPosition;
This should nullify the effect of the controller on the transform in normal scenarios.
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply
#9
I commented out those lines and I can see that the problem persists. So its not the controller. Back to the drawing board lol.
Reply
#10
I hope you will soon find the fi
Available for freelance work, feel free to reach out: toolbuddy.net
Please consider leaving a review for Curvy, this helps immensely. Thank you.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Maintaining vertical orientation of extruded meshes rickgplus 3 532 01-24-2025, 09:24 PM
Last Post: _Aka_
  Box Collider Alignment Petusarian 5 651 10-21-2024, 10:28 AM
Last Post: _Aka_
  Incorrect mesh alignment after extrusion on curved path Thinkurvy 10 1,044 04-17-2024, 10:57 AM
Last Post: _Aka_
  Shapes points orientation itsGama 3 417 01-18-2023, 02:51 PM
Last Post: _Aka_

Forum Jump: