playMaker

Author Topic: VRTK - Get Controller Velocity - always 0,0,0 ?  (Read 4163 times)

OddButAwesome

  • Playmaker Newbie
  • *
  • Posts: 49
    • Odd but Awesome Apps on Playstore
VRTK - Get Controller Velocity - always 0,0,0 ?
« on: May 23, 2018, 12:12:48 PM »
Hi all,

Having a challenging time getting a velocity reading from my Oculus Touch controller.

I am trying to upon Trigger (hold) spawn an object which I then release trigger and throw. Everything works except the throw part. I click and the fireball spawns in my hand. I can hold, move and rotate it as I wanted. When I go to throw and release the trigger it just drops to the ground.

I am watching the velocity in the inspector and it doesn't change from 0,0,0. Neither does the angular velocity. I have tried getting velocity from the RightController and the RightHandAnchor (parent when running) and also the spawned object itself.

I have tried turning the rigidbody component on/off (get/set property). Swapping the order of get / set velocity - not that this matters as the numbers still read 0,0,0.

Script Aliases for controllers are set correctly on the [VRTK_SDK_Manager].

I am obviously doing something wrong as the action works in the video tutes.

Can anyone please tell me where?

Thank you for your time reading. I appreciate your help.

Peace
JG

« Last Edit: May 24, 2018, 09:53:56 AM by OddButAwesome »

HAIRGROW

  • Playmaker Newbie
  • *
  • Posts: 24
Re: Issues with Get Controller Velocity - always 0,0,0 ?
« Reply #1 on: May 23, 2018, 02:08:30 PM »
Turn off isKinematic on the rigidbodies for the controllers, and you should able to obtain the velocity. I'm doing the same thing, but for the Vive. Hopefully it works for Occulus.
« Last Edit: May 23, 2018, 02:11:32 PM by HAIRGROW »

OddButAwesome

  • Playmaker Newbie
  • *
  • Posts: 49
    • Odd but Awesome Apps on Playstore
Re: Issues with Get Controller Velocity - always 0,0,0 ?
« Reply #2 on: May 23, 2018, 07:26:40 PM »
Hi @HAIRGROW,

Thank you for taking the time to reply.

Unfortunately this did not work. I also just retried with a clean object, collider, rigidbody. Same result. :(

I will try more when I get home from work tonight.

Regards
JG