x


[Closed] Auto shooting script.

Hello. I have a touchgame that i am working on, and its a platformer game. I have 2 cubes that are going to shoot at eachother automaticly, without the use of aiming etc.

Does anyone have some kind of script to make this work? Thanks

more ▼

asked Mar 01, 2011 at 09:50 AM

Jacob 6 gravatar image

Jacob 6
1 9 6 9

You aren't going to get very far here by requesting scripts.

You're better off researching on how to do something yourself then come back with more specific questions such as I tried this with this script I came up with, but x doesn't work, what am I doing wrong. Good luck

Mar 01, 2011 at 10:32 AM Meltdown
(comments are locked)
10|3000 characters needed characters left

The question has been closed Jun 22 at 09:03 AM by meat5000 for the following reason:

The question is answered, right answer was accepted


1 answer: sort voted first
 var projectile : Rigidbody;//HERE DRAG A BULLED WITH RIGIDBODY IN INSPECTER 
 var speed = 20;
 var rate : float = 0.5;
 private var rate_time : float;
  
 function Update()
 {
    
       rate_time = Time.time + rate;
       var instantiatedProjectile : Rigidbody = Instantiate(projectile, transform.position, transform.rotation );
       instantiatedProjectile.velocity = transform.TransformDirection( Vector3( 0, 0, speed ) );
       Physics.IgnoreCollision( instantiatedProjectile. collider, transform.root.collider );
   
 }

more ▼

answered Jun 22 at 06:29 AM

mlmihjaz gravatar image

mlmihjaz
21

(comments are locked)
10|3000 characters needed characters left

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x6472
x1414
x439

asked: Mar 01, 2011 at 09:50 AM

Seen: 1747 times

Last Updated: Jun 22 at 09:03 AM