My gameplay
- Keshav Batra
- Jan 20, 2023
- 1 min read
Initially when my player was colliding with the object, it would reset to a new platform and keep doing that. But after I changed other to transform, this is what the gameplay looks like.
Here's what it looked like before:
Initially it was the player that was causing this problem since other meant player
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Player") //Senses the player
{
other.GetComponent<PlayerMovement>().CoinAmount++; //Adds 1 to the amount of coins
transform.transform.position = Lanes[Random.Range(0, 3)].transform.position; //Setting the players position with the random lanes position
}
}
Initially it was other.position causing this problem until I looked in the inspector of the pickup and realized that transform would be the pickup keyword.
Comments