|
Help!
Mar 23, 2024 18:01:35 GMT 1
Post by edgirl on Mar 23, 2024 18:01:35 GMT 1
I know this is unrelated but can anyone who knows c# help me with this: using System.Collections; using System.Collections.Generic; using UnityEngine;
public class NoWallJump : MonoBehaviour { public PlayerMovement pm; public GameObject Controller; public bool ReachedCheckpoint; GameObject other1; // Start is called before the first frame update void Start() { }
// Update is called once per frame void LateUpdate() { if (pm.GameOver == true && ReachedCheckpoint == true) { Controller.transform.position = new Vector3(other1.transform.position.x, 0.015f , other1.transform.position.z); } } private void OnTriggerStay(Collider other) { if (other.tag == "Obstacle") { pm.jumpHeight = 0f; } if (other.name == "Parkour") { pm.jumpHeight = 2f; } if (other.tag == "Checkpoint") { ReachedCheckpoint = true; other1 = other.gameObject; } } private void OnTriggerExit(Collider other) { if (other.tag == "Obstacle") { pm.jumpHeight = 2f; } }
} The problem is I can't get the player to respawn at the checkpoint without some bugs, I'm trying to get the player once they touch the checkpoint to check if they respawn and teleport them to the checkpoint with the camera too.
|
|
Zack
Expert
a kogama expert
Posts: 134
|
Post by Zack on Mar 23, 2024 18:18:17 GMT 1
ask the robotic person for help 😈😈😈😈😈😈😈😈😈😈😈
|
|
|
Post by edgirl on Mar 23, 2024 18:23:35 GMT 1
ask the robotic person for help 😈😈😈😈😈😈😈😈😈😈😈 ok srry.
|
|