Search Unity

Weird physics issue with NewtonVR?

Discussion in 'Physics' started by troach06, Feb 23, 2017.

  1. troach06

    troach06

    Joined:
    Jan 19, 2015
    Posts:
    14
    Hey guys, I have been working on a tennis game for the HTC Vive for a while now and I have had the same bug for as long as I can remember. For some reason, whenever I turn around and hit the ball the opposite way, the ball acts like it is dead. When I turn all the way to my left and hit it, the ball ends up colliding with the racket multiple times and it seems to be even more dead. I am not adding any artificial velocity to the ball whatsoever, as I am relying on NewtonVR for the physics. I cannot for the life of me figure out why this is happening as the ball acts completely normal while facing forward. There is no artificial gravity, or any artificial forces acting on the ball besides a negative force of -1 in the y direction. I have tried everything, I even tried adding velocity to the ball while you are facing the opposite direction to compensate but it is not by any means a permanent solution. Does NewtonVR or SteamVR handle physics by your head rotation? It seems as if it is only happening when I am looking a certain direction, rather than hitting it in that direction. I'm not sure what to do at this point. If anyone has any input, please feel free to comment. Thanks!
     
  2. p1zzaman

    p1zzaman

    Joined:
    Jan 1, 2017
    Posts:
    64
    I am not familiar with NewtonVR, can you clarify when you say "turn around and hit the ball the opposite way", you mean like face away from the court?

    The steamVR camera rig's eye transform is independent of the controllers, so not sure how facing a certain direction would affect the physics of the ball unless you have special script somewhere
     
  3. troach06

    troach06

    Joined:
    Jan 19, 2015
    Posts:
    14
    When I say hit the ball the opposite way, I mean when you hit the ball towards the negative direction on the Z axis. It would make sense if I was adding some sort of artificial velocity in on the Z axis, but I'm not. It's happening automatically and I have absolutely no idea why. I just figured it would work in the opposite direction but for some reason it's different.
     
  4. p1zzaman

    p1zzaman

    Joined:
    Jan 1, 2017
    Posts:
    64
    Hmm interesting, and this happens with any object you interact with?
     
  5. troach06

    troach06

    Joined:
    Jan 19, 2015
    Posts:
    14
    Well I only have a tennis ball to interact with. It doesn't happen when I throw the ball. It goes the same distance in every direction. It's only when I hit the ball with the tennis racket that it doesn't go the same distance. I am using custom colliders for the racket, with a convex mesh collider. It's just a rigidbody colliding with another rigidbody but for some reason the rigidbody that is being hit has a different velocity in the negative Z direction than in the positive Z direction. So strange.
     
  6. p1zzaman

    p1zzaman

    Joined:
    Jan 1, 2017
    Posts:
    64
    try making it a box collider and see if you see the same issue. Just process of elimination. And you got not custom AddForce or other physics code right?
     
  7. troach06

    troach06

    Joined:
    Jan 19, 2015
    Posts:
    14
    Sorry for not getting back to you, I never saw your reply. The bug still exists and I am getting pretty frustrated. I tried using a box collider but it didn't help, same problem. I do not have any AddForce whatsoever. This leads me to believe that the bug must have something to do with NewtonVR. There is no other explanation.