playMaker

Author Topic: Set velocity / Angular velocity for throwing objects  (Read 1723 times)

topscore1632

  • Playmaker Newbie
  • *
  • Posts: 19
Set velocity / Angular velocity for throwing objects
« on: May 11, 2017, 09:46:11 AM »
Hi all,

This is probably more of a general Unity problem than Playmaker specific, but any help would be appreciated!

In a VR game I'm using Set Velocity and Set Angular Velocity to 'throw' objects out of the back of a moving truck that is animated driving in a large circle. The objects thrown are currently set to be a child of the truck. The throwing functionality works fine but the direction the objects are thrown in changes related to what part of the circle animation the truck is currently at. Sometimes it works fine but at other positions in the animation the object flies off to the side at a strange angle.

I'm guessing this is due to the objects being parented to the truck, but if I parent the thrown object to nothing it zooms off into the distance when thrown (due to not inheriting the velocity the player is travelling at).

Current solutions I'm pondering:
- Modify the Set Velocity Vector3 somehow to counteract the effect of not inheriting the speed the player is moving at
- Parent to something else

But in each case I'm stuck for ideas, this is a physics problem that's beyond my brain capacity!

Any help would be appreciated!

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Set velocity / Angular velocity for throwing objects
« Reply #1 on: May 11, 2017, 10:13:09 AM »
I'm stuck with the same problem, so would also appreciate it if anybody could shed some light on how best to do this.

In my case i need the thrown object to inherit the velocity from a moving VR camera rig so the object does not fly backwards when releasing it.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Set velocity / Angular velocity for throwing objects
« Reply #2 on: September 26, 2017, 04:14:22 AM »
Hi,

 Parenting rigidbodies only gives problem in my opinion, use joints instead.

 Have you tried joints?

 Bye,

 Jean