Question by
Smiggy56 · Apr 25, 2017 at 02:25 AM ·
scripting problemscripting beginnerscript error
hey! this problem has been bugging me cs1525 unexpected symbol `quaternion' can you please help we with this problem.
Quaternion.transrot = Quaternion.LookRotation(newposition - this.transform.position, Vector3.up);
graphics.transform.rotation = Quaternion.Slerp(transRot, graphics.transform.rotation, 0.2f);
}
}
[PunRPC]
public void RecievedMove(Vector3 movePos)
{
newposition = movePos;
}
}
Comment
Answer by AtLeastImTrying · Apr 27, 2017 at 02:04 AM
I'm really sorry for how long this took me, but I think I found a solution. I can't exactly be sure what you were looking for but I copied your script and debugged for about an hour. I came up with this: using UnityEngine; using System.Collections;
public class RecievedMovement : MonoBehaviour
{
Vector3 newPosition;
public float speed;
public float walkRange;
public GameObject graphics;
void Start()
{
newPosition = this.transform.position;
}
void Update()
{
Quaternion transRot = Quaternion.LookRotation(newPosition - this.transform.position, Vector3.up);
graphics.transform.rotation = Quaternion.Slerp(transRot, graphics.transform.rotation, 0.2f);
if (Vector3.Distance(newPosition, this.transform.position) > walkRange)
{
this.transform.position = Vector3.MoveTowards (this.transform.position, newPosition, speed * Time.deltaTime);
}
}
void RecievedMove(Vector3 movePos)
{
newPosition = movePos;
}
}
Get back to me as soon as you can if this doesn't work.
yea I think so too... he was trying declaring a variable by some other declaration... which I think doesn't make any sense.
Your answer
Follow this Question
Related Questions
Displaying Text on Touch Event 0 Answers
Getting weird error message!?!?!? 1 Answer
Error CS1519 1 Answer
Having trouble deleting objects from a list after they reach a certain scale. 0 Answers