Hi, I made a respawn system for a simple roll-a-ball game, but, every time the ball teleports back to a checkpoint, the ball clips through the floor. I want to modify the vector the script reads from by adding another vector to prevent clipping. What this script does is reads the the checkpoint object and sets the position of it as the respawn point. It is just a bit too short and needs a vector added to the vertical axis to prevent the ball from falling through as soon as it respawns.
Here’s the script and thanks in advance.
using UnityEngine;
using System.Collections;
public class checkPoint : MonoBehaviour {
private GameObject global;
private GameObject player;
void OnTriggerEnter(Collider player)
{
if(player.tag == "Player")
{
player.GetComponent<playerCheck>().checkPos = transform.position;
}
}
}
To be a little more specific, how do I add a vector to “transform.position”? (if that is possible)