Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to have an object translate through multiple checkpoints while in simulation

Discussion in 'Physics' started by animark11, Jun 17, 2017.

  1. animark11

    animark11

    Joined:
    Jul 2, 2015
    Posts:
    3
    Hi guys,

    I'm trying to move an object on a path as a script and translate through multiple checkpoints in space while in simulation.

    Is this something possible in Unity?
     
  2. eXonius

    eXonius

    Joined:
    Feb 2, 2016
    Posts:
    207
    How exactly do you mean by "while in simulation"? Do you want physics to let other objects affect the traveling object, or only let the traveling object affect other objects?

    Or are you referring to something else than physics simulation?
     
  3. animark11

    animark11

    Joined:
    Jul 2, 2015
    Posts:
    3
    Let the traveling object affect other objects. All this would happen while the simulation is running. Push or pull an object to a desired point in space.

    Im wondering if translating an object to specified points in space is possible while in simulation. It would provide some sort of real time animations with physics happening behind the scene.
     
  4. eXonius

    eXonius

    Joined:
    Feb 2, 2016
    Posts:
    207
    Put rigidbodies on all objects that are to react to physics. Then on the travelling object you put a rigidbody but set it to be kinematic. You can then translate that rigidobody and it will not be affected by other objects, but will still push other rigidbodies away.

    https://docs.unity3d.com/ScriptReference/Rigidbody-isKinematic.html