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

Add force to instantiated prefabs (c#)

$
0
0
Here is my code that I have right now but it doesn't seem to be working could anyone explain why? float x = player.transform.position.x; float y = player.transform.position.y; Vector2 origin = new Vector2(x - 3f,y - 5f); GameObject tempObj = Instantiate(lead, origin, Quaternion.identity) as GameObject; tempObj.rigidbody2D.AddForce(new Vector2(500f, 0f));

Viewing all articles
Browse latest Browse all 1264

Trending Articles



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