About Store Forum Documentation Contact



Post Reply 
Player reference
Author Message
Xardas Offline
Member

Post: #1
Player reference
Code:
Reference<Player> _player;

Code:
void SpawnPlayer()
{
   ObjectPtr obj = UID(2865708687, 1219997202, 4249387177, 1710230049);
   _player = (Player*)Game.World.objCreateNear(*obj, Matrix(obj->scale3(), Vec(0, 2, 0)));
}

Player is a Game.Chr

SpawnPlayer is called after the world is created.

objCreateNear returns null and I can't figure out why.

I know in the tutorials Game.ObjMap is always used for this (and player is placed inside the world), but I only need one player in my game, and I want to spawn him in code.
08-12-2018 08:17 PM
Find all posts by this user Quote this message in a reply
Post Reply