Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

2d Warp not working

$
0
0
So, I am trying to make it so that on contact with this boxcollider 2d, the player warps to a new zone. It is a topdown game so gravity and stuff is not an issue, and the character does have a collider as well. Also, is trigger is checked off but the character just goes through the collider and never warps. Here is my code. using UnityEngine; using System.Collections; public class Warp : MonoBehaviour { public Transform warpTarget; void OnTriggerEnter2d(Collider2D other) { Debug.Log("An object collided."); other.gameObject.transform.position = warpTarget.position; Camera.main.transform.position = warpTarget.position; } }

Viewing all articles
Browse latest Browse all 4709

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>