Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

PhysicsDemo, velocity does not get set

Discussion in 'Project Tiny' started by dimitroff, Dec 6, 2018.

  1. dimitroff

    dimitroff

    Joined:
    Apr 3, 2013
    Posts:
    103
    I have some problem with the PhysicsDemo, for some reason, the ut.Physics2D.SetVelocity2D component does not change the velocity at all, so in the demo the Cube does not move left or right. Is this a bug in the physics system or there is a different way to do this?

    Thanks!
     
  2. FinlayMcGrath

    FinlayMcGrath

    Joined:
    Apr 23, 2018
    Posts:
    4
    I've had the similar issue, I would imagine its due to the rigidbody on that object being dynamic therefore you can't change the velocity directly. I modified it so that instead of applying a velocity it applies an impulse and it now moves.
     
  3. v_vuk

    v_vuk

    Unity Technologies

    Joined:
    Jul 11, 2017
    Posts:
    19
    There's a Velocity2D component that you can add if you want to *obtain* the velocity; there's a SetVelocity2D component that you use to instantaneously set the velocity. But from looking at it now we have a bug here -- SetVelocity2D's velocity value is marked as readonly (when it should be the opposite).

    The Physics module is a work in progress at the moment; we'll have updates and fixes to it in the future that will fix a bunch of these things and add more functionality.