Instantiate new "players" in a sub folder in Hierarchy view | Unity networking with Vuforia

Debojyoti Ghosh

I am using Vuforia for creating a basic multiplayer AR project. My immediate requirement is to display multiple players in the same scene - each player is to be controlled by a separate device connected to the same network.

My current Hierarchy view is like this:

Initial Hierarchy view - using Vuforia

According to Vuforia, all assets to be rendered should go under ImageTarget. I have a player prefab which basically contains the UnityChan character along with a small player movement script (tap/ click to move to a point). The network manager is responsible for instantiating player for each device (i.e. "client" or connection) from that prefab.

Network Manager

However the player objects are created in the root folder in Hierarchy view. So they are never visible in the actual AR scene. Here's the hierarchy view during "play" mode (2 devices connected) -Hierarchy view - during play mode; 2 connections

So my question is: how can I instantiate the "players" inside the ImageTarget folder instead, so that they are visible in my AR scene?

yes

You set the parent.

Something like this

Transform imageTargetTransform = GameObject.FindObjectOfType<ImageTarget>().transform;

Player player1 = Instantiate<Player>(playerPrefab);
player1.tranform.parent = imageTargetTransform;

IDK your class names though so youll need to adapt the above for your needs.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Unity is possible to add a Game Object in hierarchy but not instantiate it?

From Dev

iOS ViewController Hierarchy changed with Unity 4.6.5 and Vuforia 4.2 update

From Dev

What is the equivalent of RPC in new Unity Networking?

From Dev

Autolayout issues when adding a new view into a hierarchy

From Dev

How to instantiate a new view controller programmatically

From Dev

ScrollView is only showing single view inside its sub-hierarchy

From Dev

.htaccess URL needs to be created for sub folder view

From Dev

Instantiate class and set properties from the editor view Unity C#

From Dev

Instantiate class and set properties from the editor view Unity C#

From Dev

Vuforia SDK Android Studio VS Vuforia Unity

From Dev

Unity3D instantiate list of prefabs in new UI

From Dev

Unity3D instantiate list of prefabs in new UI

From Dev

How to use the new Android Constraint Layout to reduce View hierarchy

From Dev

Instantiate View Controller from Storyboard vs. Creating New Instance

From Dev

Turn based networking in Unity

From Dev

How can I create a new folder within a nested folder hierarchy using Finder?

From Dev

Vuforia Object Recognition Unity Sample

From Dev

Override image feed into Vuforia in Unity

From Dev

Git does not recognize new folder adds and its sub directories

From Dev

How to Copy Sub Folders and files into New folder using Python

From Dev

Networking problems with new kernel

From Dev

Unity Hierarchy Constructor Injection

From Dev

Unable to instantiate a Behavior in Unity

From Dev

Instantiate prefab in Unity

From Dev

Instantiate prefab in Unity

From Dev

Create shell sub commands by hierarchy

From Dev

Create shell sub commands by hierarchy

From Dev

Unity 2D: Destroy + Instantiate new GameObject vs Changing state and sprite

From Dev

I get error when instantiate new game object in unity. Can anybody help me with this?

Related Related

  1. 1

    Unity is possible to add a Game Object in hierarchy but not instantiate it?

  2. 2

    iOS ViewController Hierarchy changed with Unity 4.6.5 and Vuforia 4.2 update

  3. 3

    What is the equivalent of RPC in new Unity Networking?

  4. 4

    Autolayout issues when adding a new view into a hierarchy

  5. 5

    How to instantiate a new view controller programmatically

  6. 6

    ScrollView is only showing single view inside its sub-hierarchy

  7. 7

    .htaccess URL needs to be created for sub folder view

  8. 8

    Instantiate class and set properties from the editor view Unity C#

  9. 9

    Instantiate class and set properties from the editor view Unity C#

  10. 10

    Vuforia SDK Android Studio VS Vuforia Unity

  11. 11

    Unity3D instantiate list of prefabs in new UI

  12. 12

    Unity3D instantiate list of prefabs in new UI

  13. 13

    How to use the new Android Constraint Layout to reduce View hierarchy

  14. 14

    Instantiate View Controller from Storyboard vs. Creating New Instance

  15. 15

    Turn based networking in Unity

  16. 16

    How can I create a new folder within a nested folder hierarchy using Finder?

  17. 17

    Vuforia Object Recognition Unity Sample

  18. 18

    Override image feed into Vuforia in Unity

  19. 19

    Git does not recognize new folder adds and its sub directories

  20. 20

    How to Copy Sub Folders and files into New folder using Python

  21. 21

    Networking problems with new kernel

  22. 22

    Unity Hierarchy Constructor Injection

  23. 23

    Unable to instantiate a Behavior in Unity

  24. 24

    Instantiate prefab in Unity

  25. 25

    Instantiate prefab in Unity

  26. 26

    Create shell sub commands by hierarchy

  27. 27

    Create shell sub commands by hierarchy

  28. 28

    Unity 2D: Destroy + Instantiate new GameObject vs Changing state and sprite

  29. 29

    I get error when instantiate new game object in unity. Can anybody help me with this?

HotTag

Archive