- Home /
Reset Transform.position
Hi guys. I have this GameManager reset function, it all goes well besides the fact that when i want to reset a gameObject's transform.position, it doesn't reset the first time i click the restart button, unless i click it once and then repeat the procedure fast.
void Start() { platformStartPoint = PlatformGenerator.position; backgroundStartPoint = BackgroundGenerator.position; playerStartPoint = thePlayer.transform.position; tantarGeneratorStartPoint = tantarGenerator.position; frontMinionsGeneratorStartPoint = frontMinionsGenerator.position;
public void Reset() {
theDeathScreen.gameObject.SetActive(false);
platformList = FindObjectsOfType<PlatformDestroyer>();
for (int i = 0; i < platformList.Length; i++)
{
platformList[i].gameObject.SetActive(false);
}
thePlayer.transform.position = playerStartPoint;
tantarGenerator.position = tantarGeneratorStartPoint;
frontMinionsGenerator.position = frontMinionsGeneratorStartPoint;
}
help me out please, thanks!
Answer by _Venus_ · Sep 07, 2018 at 01:11 PM
Is the player resetting their position? If so try adding .transform as the tantarGenerator and the frontMinionsGenerator.
the player and the tantargenerator is resetting position, that's the akward thing, i also added .transform before but is the same thing. it s very strange, thanks for reply tho