Player won’t move after respawning

Updated on November 28, 2018 in [A] Brackeys Courses
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on February 11, 2018

I’m on Ep 12. of the 2D platformer tutorial but my player won’t move after being respawned. Plz help? I’m not sure if it’s a problem with the input manager or something.

  • Liked by
  • SnakeBoy229
Reply
1 on November 28, 2018

same here…i don’t know what’s wrong

using UnityEngine;
using System.Collections;

public class GameMaster : MonoBehaviour{

public static GameMaster gm;

public void Start()
{
if (gm == null)
{
gm = GameObject.FindGameObjectWithTag(“GM”).GetComponent<GameMaster>();
}
}

public Transform playerPrefab;
public Transform spawnPoint;

public void RespawnPlayer()
{
Instantiate(playerPrefab, spawnPoint.position, spawnPoint.rotation);
}

public static void KillPlayer(Player player)
{
Destroy(player.gameObject);
gm.RespawnPlayer();
}

}

 

i used prefabs from my assets files, he doesn’t move, he’s just frozen

on November 28, 2018

update, i added the delay and stuff and now he flashes into the game for a milisecond and spawns out again

Show more replies
  • Liked by
Reply
Cancel