Sign in to follow this  
Amberalex

Set bullet property

Recommended Posts

Hello.

I am using weapon.fire() function and I want to set special property for bullet, that apear after calling this function. 

I tried to use forEach:

weapon.bullets.forEach(function(bullet){
 if(bullet.target == undefined){
  bullet.taget = 'prop1';
  return;
 }
});
weapon.fire();

but this does not work.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.