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

Add Force if GameObject is detected in a Polygon Collider 2D

$
0
0
Let's say that I have a Player, and my player can walk, run, and jump. Also, my player has a Polygon Collider 2D and if 2D GameObjects( with a Rigidbody2D and Box Collider 2D) are detected in the Polygon Collider 2D the Player will Add Force to movable 2D GameObjects that are in the Polygon Collider 2D to be pulled towards the Player. (One)- How can I detect if any 2D GameObjects are in the Polygon Collider? & (Two)- How can I Add Force to movable 2D GameObjects that are in the Polygon Collider 2D to be pulled towards the Player? ------ Please code and explain your answer, for I am new to unity and won't understand if you just give me directions, I don't just use your code and forget about it, I write it down in my note book line to line and review and study it on my free time

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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