Hello!
In my game im getting an error for mouse is not defined. Screenshot is here
This just allows me not to switch weapons and shoot.
don’t understand why it does that, seems to be the correct syntax
1 Like
Same here, Im not sure why it does that
Started happening when I added my shotgun in the same Shotty and then I put it in the script and now there is a error in launch
Forked your project to see the problem and debug it, seems that you have placed the code outside the update function, this should work
Shoot.prototype.update = function(dt) {
if (this.app.mouse.was(pc.MOUSEBUTTON_LEFT) && this.weapon == "Pistol") {
this.Shoot({
par: this.app.root.findByName(this.weapon),
spd: 0.5,
spos: this.app.root.findByName("Bullet_Hole").getPosition()
});
}
};
2 Likes
Ok I will try! Thanks for your help.
1 Like
Worked!