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

Shoot logic, bullet instantiation

$
0
0
Hey ! I'm having a issue when I want to instantiate a bullet going from my gun and to infinity. The bullet gets the right rotation from the code, but not the right force added. Can anyone help me out ? Debug.Log("Shoot!"); //GunBlazeAnimation.Play(); GameObject clone; Vector2 mousePos = Input.mousePosition; GunBlazeAnimator.SetTrigger ("GunBlazeAnimation"); shotgunSource.Play (); clone = (GameObject)Instantiate (bulletPrefab, GunBlazeGameObject.transform.position, GunBlazeGameObject.transform.rotation); clone.transform.rigidbody2D.AddForce(mousePos * 10.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>