cancel
Showing results for 
Search instead for 
Did you mean: 

Adding weapon kickback to the avatar hands?

Anonymous
Not applicable
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?
3 REPLIES 3

MikeF
Level 10
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

Anonymous
Not applicable

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?

MikeF
Level 10
Yeah you got it