Adding weapon kickback to the avatar hands? — Oculus
Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

Adding weapon kickback to the avatar hands?

HittmanAHittmanA Posts: 2
NerveGear
edited January 5 in Unity Development
Hi there! I'm trying to add some kickback from projectile weapons (to simulate a muzzle kick), but whenever I try to add a rotational force to the avatar hands from the Oculus Integration, nothing at all happens. I checked to make sure there was a rigidbody component on the hands, and that the rigidbody was not set to kinematic. Any and all attempted rotation changes to the hands seems to be completely nullified. Is there a way around this?

Comments

  • MikeFMikeF Posts: 574
    Neo
    Youl have to add an interupt into the avatar pose update loop otherwise all transforms will be derived from your touch controllers. So the basic implementation would be something like this:
    -fire gun
    -pause pose update on relevant hand
    -copy and apply last pose transforms (otherwise they will be set to 0,0,0 in local space)
    -apply your kickback animation (canned or procedural via physics in your case)
    -wait until kickback completes
    -re-enable pose updates
  • HittmanAHittmanA Posts: 2
    NerveGear
    edited January 6
    MikeF said:
    Youl have to add an interupt into the avatar pose update loop otherwise all transforms will be derived from your touch controllers. So the basic implementation would be something like this:
    -fire gun
    -pause pose update on relevant hand
    -copy and apply last pose transforms (otherwise they will be set to 0,0,0 in local space)
    -apply your kickback animation (canned or procedural via physics in your case)
    -wait until kickback completes
    -re-enable pose updates
    Ok, that makes sense, thanks. I'm new to using the Oculus SDK, so I'm not entirely sure where the pose update function you're referring to is. I assume it's the 'UpdateTransforms' function in OvrAvatar, right?
  • MikeFMikeF Posts: 574
    Neo
    Yeah you got it
Sign In or Register to comment.