Quantcast
Channel: Answers by "maxkunes"
Viewing all articles
Browse latest Browse all 18

Answer by maxkunes

$
0
0
I see the way your doing it and I think that that is a unneeded approach to what you are trying to do. When ever I work with bullet spawns I would either use ray cast and there's a billion tutorial on that or the best option for what your doing is to make a bullet spawn object. Create a empty game object Name it as Desired Position it linked to the tank's barrel as a child and rotate it to the desired degree Then fix the code... var firePos : Transform; function ShootCannon(){ //this is the bullet creation var instance = Instantiate(Bullet, firePos.position, firePos.rotation); instance.velocity = transform.TransformDirection (Vector3.forward * BulletSpeed); //note: I want the rotation of the actually fireing to have an //angle of +20 degrees from which the bullet comes out of. In my opinion this is a very simple and effective way to solve your issue. ***Warning Did not Test Code so there may be some simple errors but I dont think so...***

Viewing all articles
Browse latest Browse all 18

Trending Articles



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