So I’ve been making a game with a battle system. When the player presses down z or enter in the menu they enter an attack. So I made this code to teleport the character into the attack box and shrink them down. But they get shrunk down and don’t teleport. Everything but transform.position
works. This is a sprite in a 2D game if that helps.
if (Input.GetKeyDown ("z") || Input.GetKeyDown ("return")) { textbox.SetActive (false); bulletboard.SetActive (true); soul.transform.position = new Vector3 (-0.3423029f, -1.97f, 0f); soul.transform.localScale = new Vector3 (0.1f, 0.1f, 0f); isfighting = true; }
Thanks in advance!