10-18-2017
11:17 PM
- last edited on
07-16-2024
03:08 PM
by
The_1st_Dark_Lo
I'm working off the standard OVRPlayerController, which has an OVRCameraRig as its child.
This is a game where I need thumbstick locomotion (which the OVRPlayerControllerProvides), but I also need roomscale movement. In other words, I need to make sure that when the player moves physically, his in game avatar should also move.
Currently whats happening is that when the player moves physically, the OVRcameraRig moves with him, but the parent OVRPlayerContoller does not move. This is an issue because I need my OVRPlayerController to move with my player at all times for proper collision tracking and targeting by Hostile AI.
What is the best way to achieve this? Iv'e tried a few ways to make it work but wondering what the cleanest solution is. I'll also need hand tracking for this game. Perhaps I should simply use the AvatarSDK standard avatar and make it a child of a Character Controller for thumb stick movement?
thanks for the help!
10-21-2017 05:23 PM
11-20-2017 07:28 PM
imperativity said:
@tkdHayk
I have elevated this and your other forum request to the Avatars team for their consideration on making a tutorial within the documentation to achieve this behavior. Hopefully this will be up by the end of the year.
02-10-2018 09:21 PM
03-02-2018 09:23 AM
03-13-2018 04:25 PM
06-30-2018 10:07 PM
//add these inside your class
//Make sure you bind this in Unity by dragging the OVRPlayerController from the Hierarchy to the script
public OVRPlayerController player;
CharacterController character;
void Awake(){
// ...
// add this
character = player.GetComponent<CharacterController>();
}
void Update(){
//...
//add this
character.center = centerEyeAnchor.transform.localPosition;
}
08-13-2018 08:18 PM
12-20-2019 07:20 AM
if(EnableFadeout){
`... are actually commented out and so this option no longer does anything. it appears to be because the OVRInspector.instance.fader
instance no longer exists in the newer codebase.//if (EnableFadeout)
//{
//float fadeLevel = Mathf.Clamp01((CurrentDistance - FadeMinDistance)/ (FadeMaxDistance - FadeMinDistance));
//OVRInspector.instance.fader.SetFadeLevel(fadeLevel * MaxFade);
//}
if (EnableFadeout)
{
float fadeLevel = Mathf.Clamp01((CurrentDistance - FadeMinDistance)/ (FadeMaxDistance - FadeMinDistance));
OVRScreenFade _screenFadeScript = GetComponent<OVRScreenFade>()
if(_screenFadeScript != null) _screenFadeScript.SetFadeLevel(fadeLevel * MaxFade);
}
if(EnableFadeout)
`08-22-2020 03:46 PM