- Home /
The name `tranform' does not exist in the current context
Having a problem...
Code:
using UnityEngine;
using System.Collections;
public class NetworkCharacter : MonoBehaviour {
void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) {
if (stream.isWriting) {
// This is OUR player
stream.SendNext(tranform.position);
stream.SendNext(tranform.rotation);
} else {
// And this is someone else's player
transform.position = (Vector3)stream.ReceiveNext();
transform.rotation = (Quaternion)stream.ReceiveNext();
}
}
}
Errors:
Assets/_SCRIPTS/NetworkCharacter.cs(9,41): error CS0103: The name `tranform' does not exist in the current context
Assets/_SCRIPTS/NetworkCharacter.cs(10,41): error CS0103: The name `tranform' does not exist in the current context
Which is in "//This is OUR player" Script is included in my Player prefab.
Answer by HarshadK · Aug 05, 2014 at 09:50 AM
It is 'transform' and not 'tranform'.
Its just a spelling mistake.
Answer by CHPedersen · Aug 05, 2014 at 09:51 AM
Look at your code. You're written "tranform" instead of "transform". The variable has an 's', there. That's what the compiler is trying to tell you. It can't recognize "tranform" as a variable name, because it doesn't exist.
Your answer
Follow this Question
Related Questions
Problems with Photon self-hosted server 0 Answers
Photon Unity Networking Score Issue 1 Answer
How to network a large map with 4000+ movable objects using Photon Unity Networking? 1 Answer
Unity3D Photon movement synchronization 0 Answers
Using lerp to smooth network movement causes rubber banding 1 Answer