Changing entity rotation with euler?
Hey  I am trying to change rotation of a prefab. But the prefab always faces north. anything I am doing wrong?
var test= GameManager.server.CreateEntity("assets/prefabs/player/player.prefab",pos,Quaternion.Euler(0f, 180f, 0f), true);
test.Spawn();​

That seems to be a specialty of the player.prefab ... (if you use a loot crate, it works as you posted)

test.transform.SetPositionAndRotation(player.transform.position, Quaternion.Euler(0f, 140f, 0f)); seems not to work either... 

I'll keep trying, this has me hooked now :)



Merged post

Well, that's sure to do with the player.prefab. I found the following to work:

BasePlayer test = GameManager.server.CreateEntity("assets/prefabs/player/player.prefab", pos, new Quaternion()).ToPlayer(); 
test.Spawn();
test.OverrideViewAngles(new Vector3(0f, 180f, 0f));
test.SendNetworkUpdate();

if you have a crate or something, it works directly as you posted.

Thanks and do you have any idea how to do so they look straight because now they look with head only not the whole body.

Merged post

The player.prefab head is aiming there but I wanna move his body not only head