- Home /
Unresponsive Floating character after respawn
Hi All,
I am making a 2d side scroller game using the first person controller with mouse look off, the prefab camera deleted, and the vertical vector permanently set to zero. My game currently plays fine until it is time for my character to respawn. My character respawns but just floats in the air afterward unresponsive I currently have no clue why. Any help would really be apprecitated. I put my respawn script below.
Here is my script
#pragma strict
var Player : GameObject;
var spawnPoint: Transform;
function OnTriggerEnter(other : Collider)
{
Destroy(other.gameObject);
var P : GameObject = Instantiate(Player,spawnPoint.transform.position, Quaternion.identity);
var sf = Camera.main.GetComponent(SmoothFollow2);
sf.target = P.transform;
}
Since your player is a prefab, ensure it's current with the one I'm assu$$anonymous$$g you have in your hierarchy at Run time; check that all the associated scripts are present on the prefab, the right tag/layers are set, etc.
Thanks for your response. I checked to make sure my prefab is has all of the same settings and attachments as the player in my hierarchy at run time. Every thing is there but the clone of my player is still frozen.
double check that your prefab (once spawned) in the Editor has Character$$anonymous$$otor attached with Can Control ticked?
Again thanks for the response. I just doubled checked to make sure the Character$$anonymous$$otor script was attached and Can Control was ticked. Both of those things are as they should be.I have attached an screen shot of what I am seeing
Is your movement code depending on something like 'is grounded'? The respawn (if that's where it is) seems to be in the air