Attach Camera to Player
This commit is contained in:
@@ -124,7 +124,7 @@ public class Player : NetworkBehaviour
|
||||
if (nameTagPrefab != null)
|
||||
{
|
||||
nameTagInstance = Instantiate(nameTagPrefab, transform);
|
||||
nameTagInstance.transform.localPosition = new Vector3(0f, nameTagHeight, 0f);
|
||||
nameTagInstance.transform.localPosition = new Vector3(0f, 2.0f, 0f);
|
||||
nameTagInstance.transform.localRotation = Quaternion.identity;
|
||||
// try to find either a TextMesh or legacy TextMesh in the prefab
|
||||
nameTagTextMesh = nameTagInstance.GetComponentInChildren<TextMesh>();
|
||||
@@ -134,7 +134,7 @@ public class Player : NetworkBehaviour
|
||||
// create a simple 3D text (TextMesh) so no extra UI package is required
|
||||
nameTagInstance = new GameObject("NameTag");
|
||||
nameTagInstance.transform.SetParent(transform, false);
|
||||
nameTagInstance.transform.localPosition = new Vector3(0f, nameTagHeight, 0f);
|
||||
nameTagInstance.transform.localPosition = new Vector3(0f, 2.0f, 0f);
|
||||
|
||||
nameTagTextMesh = nameTagInstance.AddComponent<TextMesh>();
|
||||
nameTagTextMesh.alignment = TextAlignment.Center;
|
||||
|
||||
Reference in New Issue
Block a user