A
A
artem_music2016-11-01 16:23:40
Physics
artem_music, 2016-11-01 16:23:40

Fix suspension elements in z-axis in Unity3D?

Good evening dear community.
I'm making a simple game in unity, I decided to attach a suspension to the space module based on wheeljoint2d.
f6a56f4302134881a8e2e0d36e4a55d9.png
It works great, but there is one caveat.
If the Z-axis is fixed at the suspension elements, then everything looks like this:
bb9fb6e9cb8f43928457f51b0f240de0.png
And when the ship turns, accordingly, the suspension is always directed downwards.
If you turn off the fixation of the Z axis, then everything seems to be as it should be:
d827e70d2c4e485e93220826817b9a68.png
But there is a problem - in this case, the following situation may happen (I marked the direction of the suspension elements with blue arrows):
8da688d294714df6ae5cc859548d5df9.png
How can I fix the position relative to the parent element in the gap? For example, so that suspension elements can only rotate within a certain angle:
80b929b584fe46a990a110c6202a6500.png
Thanks in advance for your answer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2016-11-02
@artem_music

I don’t know how exactly you implemented the script part of the suspension, but you can fix the elements in certain corners with the function:
it rigidly holds values ​​in the min........max range. You can control the angles with this function.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question