Forum Discussion

Darnellyicious's avatar
Darnellyicious
Honored Guest
13 days ago

HelloWorld & Basic Sound tutorials

Hello, hoping somebody has an answer for this. I've been trying to get this basic voice input working and have been running into an issue.

https://developers.meta.com/horizon/documentation/unity/unity-tutorial-basic-voice-input/

https://developers.meta.com/horizon/documentation/unity/unity-tutorial-hello-vr/

The issue is I receive and error that says...

Script 'CharacterController' has the same name as built-in Unity component.
AddComponent and GetComponent will not work with this script.

Both meta and unity have a CharacterController. I have been unable to get around this as I need the AddComponent and GetComponent to work.

I can't be the first person to come across this; particular when its in a hello world example and yet I can't find any information on it.

Help would be appreciated.

Thanks

 

 

2 Replies

  • Degly's avatar
    Degly
    Start Partner

    This is a name conflict

    You created (or imported) a script called CharacterController, which clashes with Unity’s built-in UnityEngine.CharacterController.

    Fix:

    • Rename your script (e.g. MyCharacterController)
    • Or explicitly reference Unity’s one:

    GetComponent<UnityEngine.CharacterController>();

    Unity won’t resolve AddComponent/GetComponent correctly when names collide, so renaming is the safest fix.

    • Darnellyicious's avatar
      Darnellyicious
      Honored Guest

      Thanks for your reply but that's not it. If you read my post it says "Both meta and unity have a CharacterController." I did  not create this charactercontroller. Meta also has a charactercontroller so i can not rename it as its part of meta and its conflicting with the unity character controller. There has to be a way to pick one over the other but I can't find it.

→ Find helpful resources to begin your development journey in Getting Started

→ Get the latest information about HorizonOS development in News & Announcements.

→ Access Start program mentor videos and share knowledge, tutorials, and videos in Community Resources.

→ Get support or provide help in Questions & Discussions.

→ Show off your work in What I’m Building to get feedback and find playtesters.

→ Looking for documentation?  Developer Docs

→ Looking for account support?  Support Center

→ Looking for the previous forum?  Forum Archive

→ Looking to join the Start program? Apply here.

 

Recent Discussions