Question by
EddyDavila · Nov 08, 2018 at 07:13 PM ·
multiplayer-networkinglocalrotationserverside
Can I write code inside the !isLocalPlayer function? C#
What are the downfalls of writing code inside the Start(){ isLocalPlayer == false } function? Is this acceptable? Everything seems to work properly but I want to be sure.
> void Start () {
if( isLocalPlayer == false)
{ // change rotation for client player objects.
changeRotTest.transform.Rotate(0, 180, 0);
changeRotTest2.transform.Rotate(0, 180, 0);
changeRotTest3.transform.Rotate(0, 180, 0);
changeRotTest4.transform.Rotate(0, 180, 0);
return;
}
I wrote code before the return statement so it is sent to the second player before game starts. I did this because if not; the second player spawn uses player 1 rotation and they would otherwise not face each other. How acceptable is this? What problems can this cause if any? I appreciate any input. Thank you
Comment
Answer by EddyDavila · Nov 09, 2018 at 04:00 AM
Well the answer is no. Code can be placed there but it wont have any positive effect. It creates bugs and unwanted behavior. Thanks for the help anyway.