Quantcast
Channel: Questions in topic: "addforce"
Viewing all articles
Browse latest Browse all 1264

Trying to make a bounce platform that tosses the player.

$
0
0
I want to make a bounce platform. I tried to figure it out myself but no luck. I got it to work somewhat, but for some reason it would only work if I entered the trigger from the left side. So after trying different things this is what I have right now and its not doing anything. This is probably the wrong way to do it, so any suggestions would help. public float bounciness; void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Player") { GameObject player = GameObject.FindGameObjectWithTag("Player"); player.GetComponent().AddForce(Vector2.up, ForceMode2D.Force); } }

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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