Rex G
Rex G4d ago

Meta Avatar Positioning

The avatar spawns pretty close the floor. Is there any way to fix the positioning on the Meta Avatar Rig? I need for it to be higher up so the players can interact with the app.
18 Replies
kapa.ai
kapa.ai4d ago
Hi @Rex G. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- To address the issue of Meta Avatar positioning in NormalVR, we can make some adjustments to the avatar prefab. Based on the information provided in the knowledge sources, here's how you can modify the avatar's position: 1. First, locate your Meta Avatar prefab. If you're using the default one, it's likely called "Meta Avatar Player" or something similar. 2. In your Unity scene, create an empty Game Object and add the MetaAvatar component to it. You can name this object "Custom Meta Avatar" or any name of your choice. 3. Click the "Set Up Meta Avatar" button on the MetaAvatar component. This will configure the necessary components for the avatar. 4. Now, you can adjust the position of this Game Object to raise it higher off the ground. You can do this by modifying the Y value of its transform in the Unity Inspector. 5. Once you've adjusted the position to your liking, drag this Game Object into your project to create a new prefab. Make sure to place it in a Resources folder so it can be instantiated at runtime. 6. Finally, connect this new prefab to the RealtimeAvatarManager component under "Local Avatar Prefab" in your scene. This approach allows you to customize the avatar's starting position while maintaining the functionality provided by the MetaAvatar component. For more detailed information on setting up and customizing Meta Avatars with NormalVR, you can refer to the Meta Avatars Customization guide. If you need further customization or control over the avatar's position during runtime, you might need to modify the avatar prefab or create a custom script to adjust its position dynamically. However, the knowledge sources don't provide specific information on runtime positioning adjustments for Meta Avatars in NormalVR. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai4d ago
<@918869683929768036> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
maxweisel
maxweisel4d ago
cc @NormalMark
NormalMark
NormalMark4d ago
Hey, by default the feet of the avatar should be at the Y=0 of your scene
NormalMark
NormalMark4d ago
If the floor in your Unity scene is at a different position than 0, you can change the Y on the transform of the player root by script:
No description
NormalMark
NormalMark4d ago
It's Meta Avatar Player(Clone) by default You can test it in the editor by dragging the transform directly until the feet align with the floor This should do the trick, if not could you describe your Unity scene and setup? Alternatively the most simple solution I guess could be to lower the scene until the floor matches exactly Y=0. If the scene is simple enough to do that easily.
Rex G
Rex GOP4d ago
It would be easier to do it by script because its alot tied to the prefab of the scene and changing the floor would move everything around and that would be a hassle Where do I change the y position? In the Meta Avatar Player Prefab?
NormalMark
NormalMark4d ago
There's many ways to structure that code, here's a simple approach I would do: A script like this:
c#
using UnityEngine;

public class CharacterController : MonoBehaviour
{
public float FloorY;

private void Awake()
{
var pos = transform.position;
pos.y = FloorY;
transform.position = pos;
}
}
c#
using UnityEngine;

public class CharacterController : MonoBehaviour
{
public float FloorY;

private void Awake()
{
var pos = transform.position;
pos.y = FloorY;
transform.position = pos;
}
}
Rex G
Rex GOP4d ago
Ok so a script like this for example would be attached the Meta Avatar Prefab?
NormalMark
NormalMark4d ago
And add it to the Meta Avatar Player prefab:
No description
Rex G
Rex GOP4d ago
Oh great I will try this
Rex G
Rex GOP4d ago
This is how my scene is setup I am using a rig because my players need to be able to move
No description
Rex G
Rex GOP4d ago
But the rig ends up digging into the floor
Rex G
Rex GOP3d ago
Here is my script it keeps sinking the player to the floor still even using this script
NormalMark
NormalMark3d ago
I would guess something else is overwriting the position in an Update() call later Like the OVRCameraRig I'm not very familiar with that component, it's the sample rig from Meta right?
Rex G
Rex GOP3d ago
Yeah
NormalMark
NormalMark3d ago
Try running your logic in Update() Or even LateUpdate() If it works in LateUpdate but not Update then we'd know a different script is interfering
Rex G
Rex GOP3d ago
Ok I will give that a try Is there any way to just remove the feet of the player and it will just remain in its position because its not necessary for my players to use their legs.

Did you find this page helpful?