Search Unity

  1. Full schedule for #UniteBerlin is now available! Featuring talks on our roadmap, hands-on labs and much more! Check it out!
    Dismiss Notice
  2. Unity 2018.1 has arrived! Read about it here
    Dismiss Notice
  3. Scriptable Render Pipeline improvements, Texture Mipmap Streaming, and more! Check out what we have in store for you in the 2018.2 Beta.
    Dismiss Notice
  4. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  5. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  6. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

2D Proxy Rendering Object, how?

Discussion in 'Physics' started by Deeeds, May 15, 2018.

  1. Deeeds

    Deeeds

    Joined:
    Mar 15, 2018
    Posts:
    269
    I've got a spinning physics object, that's spinning too fast for enjoyable visualisation and perception by the player. It moves around a lot, and spins really fast. I want to show it spinning slower, whilst it's actually spinning FAST.

    My solution/idea: put a sprite in front of it, that moves with it, that spins slower, and changes texture based on spin rate, as a visual proxy for the underlying object.

    The proxy has a rigid body and I set the angular velocity to a percentage of the actual object. That part works, quite nicely. When they're not connected.

    However, if I nest the proxy sprite to the object, this causes it to spin at the same rate as the parent object, regardless of how I try to control it. It moves well, with the object, but rotates too well, at exactly the parent object's rate.

    If I un-nest it, and move it to the position of the object every frame, this always creates some lags and other side effects, but I do have perfect control of the spin rate.

    Is there some elegant and simple solution to this type of problem I'm overlooking, where I get perfect positional representation and control over the speed of spin of the proxy object?
     
  2. PGJ

    PGJ

    Joined:
    Jan 21, 2014
    Posts:
    744
    Have you tried doing it the other way around, that is parent the main object to the proxy object?
     
  3. Deeeds

    Deeeds

    Joined:
    Mar 15, 2018
    Posts:
    269
    Yes, I did this first, by mistake. It caused all sorts of weirdness. Couldn't get it to be at all useful. Then I remember that WheelJoint2D is wheel to body, flipped the parenting and it worked, but just not well. Lag, sag and other issues.