playMaker

Author Topic: [Unresolved]Character Rotation  (Read 5883 times)

stigma

  • Full Member
  • ***
  • Posts: 176
[Unresolved]Character Rotation
« on: September 01, 2020, 10:20:13 AM »
Hello,
I'm new to Oculus Rift S on Unity 5.6.2
I am able to move my character forward with the left controller but I am unable to rotate with the right controller. I have tried a lot of commands but nothing helps.
How do I proceed ?
Thank you
« Last Edit: September 06, 2020, 04:11:42 AM by stigma »

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Character Rotation
« Reply #1 on: September 01, 2020, 11:37:24 AM »
Hey there Stigma.

I made a short explanation in another thread a while ago on how to get basic thumbstick / touchpad rotation working in VR.

https://hutonggames.com/playmakerforum/index.php?topic=21955.msg96286#msg96286

stigma

  • Full Member
  • ***
  • Posts: 176
Re: Character Rotation
« Reply #2 on: September 01, 2020, 02:58:55 PM »
I can't find "Rotate Around"
Do you have an FSM example?

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Character Rotation
« Reply #3 on: September 01, 2020, 03:37:22 PM »
Just import this package into your project and drag the prefab into your current scene and follow the instructions in the FSM.

This is setup for SteamVR with a custom action that you can just swap out for the one you're using. It's basic but it should work.

Let me know if you have any problems.
« Last Edit: September 02, 2020, 12:17:57 PM by LordHorusNL »

stigma

  • Full Member
  • ***
  • Posts: 176
Re: Character Rotation
« Reply #4 on: September 02, 2020, 03:32:08 AM »
I copied the FSM states to my right controller
« Last Edit: September 02, 2020, 03:40:25 AM by stigma »

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Character Rotation
« Reply #5 on: September 02, 2020, 12:19:42 PM »
Sorry i forgot that FloatMultiplyTarget was a custom action, you can just swap it out for float multiply if you want.

I updated the package so it should work now.

stigma

  • Full Member
  • ***
  • Posts: 176
Re: Character Rotation
« Reply #6 on: September 02, 2020, 03:41:20 PM »
I am a little lost, I understand less and less what to do. The left stick to move forward still works well.
I have lots of valve errors.

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Character Rotation
« Reply #7 on: September 03, 2020, 12:01:59 PM »
Two things.

1: In the inspector CameraRig should be your [CameraRig] and not your CameraVR.



2: Vector2Action in the inspector should be TouchpadAxis.

And then in Unity got to window / SteamVR Input.
Add a Vector2 action to the list, name it TouchpadAxis and press save and generate.



Open BindingUI > Current Binding > Edit.
On Thumbstick press the + symbol > Use as Joystick.
Set the position on this new Joystick to TouchpadAxis.



Profit. :P
« Last Edit: September 03, 2020, 12:27:56 PM by LordHorusNL »

stigma

  • Full Member
  • ***
  • Posts: 176
Re: Character Rotation
« Reply #8 on: September 04, 2020, 11:10:45 AM »
Should I put CameraRig in FSM instead of Camera?
I have this error

Code: [Select]
NullReferenceException: Object reference not set to an instance of an object
Valve.VR.SteamVR_Input_Source.GetHandle (SteamVR_Input_Sources inputSource) (at Assets/SteamVR/Input/SteamVR_Input_Source.cs:29)

LordHorusNL

  • Beta Group
  • Full Member
  • *
  • Posts: 226
Re: Character Rotation
« Reply #9 on: September 04, 2020, 11:39:13 AM »
Don't change anything in the FSM itself.

Just make sure you have these settings in the inspector.



If things don't work after that, you probably made a mistake with setting up your SteamVR action.

Your unity version 5 is also pretty old and i have no idea if that might cause problems because i haven't tested this package in unity 5.

*Edit*

I tried using the package on Unity 5.6 but no luck, in my case it just crashes. Unity 5.6 is just to old so i'm afraid i cant help you any further.
« Last Edit: September 04, 2020, 02:02:27 PM by LordHorusNL »

stigma

  • Full Member
  • ***
  • Posts: 176
Re: Character Rotation
« Reply #10 on: September 05, 2020, 03:41:01 AM »
it does not matter. Thanks for spending time with me.
Have a nice day