Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How to set parent follow the child

So I have a spaceship that has 8 directional thrusters for rotating and moving. They are all child of the ship, so when the ship moves, thrusters are moving too. But I want the ship to move as force is applied to thrusters. So how do I make ship follow the thrusters?


Answers

  • The thrusters are just graphical representations you dont need the parent to follow. What you could do is have a forward backwards value a right left value and an up down value which you pass in to a vector 3. For example:


    //Logic to set the values I.E. input.getkey etc.

    Vector3 v = new Vector3(fowards - backwards, right - left, up - down);

    CharachterController.Move(v)

    The same can be done for rotation using qaternion.

    You can change the appearance of the thrusters based on the values for example if the up value was higher than the down value you would turn it on else it would be off.

Sign In or Register to comment.