- Home /
Character Position error
For some reason, my character model keeps winding up about 4000 feet below the screen whenever I move him into a collision with another object. The error pops up occasionally on my other games as well. Edit: Added code to post. Also, noticed that the editor skips a bit right before misplacing it.
// Pick Ups var spinspeed : float = 50.0;
function Update() { //Make it spin
var spinRotation = Time.deltaTime * spinspeed; transform.Rotate(spinRotation, spinRotation, 0); }
// gets called when we hit something as a trigger function OnTriggerEnter(other:Collider) { // what are we hitting? we're only interested in hitting objects tagged as "Player" if(other.gameObject.CompareTag("Player")) { // send a message to that object telling it to run that function other.gameObject.SendMessage("Pickup", null); // destroy ourselves Destroy(gameObject); } }