Skip to content
This repository was archived by the owner on Oct 20, 2021. It is now read-only.

Commit 59a4338

Browse files
author
Paul Balaji
authored
Add variable for position/coords when creating Player entity template (#123)
1 parent a0d0442 commit 59a4338

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

workers/unity/Assets/BlankProject/Scripts/Config/EntityTemplates.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Improbable.Gdk.Core;
33
using Improbable.Gdk.PlayerLifecycle;
44
using Improbable.Gdk.QueryBasedInterest;
5+
using UnityEngine;
56

67
namespace BlankProject.Scripts.Config
78
{
@@ -12,8 +13,11 @@ public static EntityTemplate CreatePlayerEntityTemplate(EntityId entityId, strin
1213
var clientAttribute = EntityTemplate.GetWorkerAccessAttribute(workerId);
1314
var serverAttribute = UnityGameLogicConnector.WorkerType;
1415

16+
var position = new Vector3(0, 1f, 0);
17+
var coords = Coordinates.FromUnityVector(position);
18+
1519
var template = new EntityTemplate();
16-
template.AddComponent(new Position.Snapshot(), clientAttribute);
20+
template.AddComponent(new Position.Snapshot(coords), clientAttribute);
1721
template.AddComponent(new Metadata.Snapshot("Player"), serverAttribute);
1822

1923
PlayerLifecycleHelper.AddPlayerLifecycleComponents(template, workerId, serverAttribute);

0 commit comments

Comments
 (0)