MachineGunImplementation

Heyy guys, been trying to make a few guns for my Mega Challenge. Well I have been trying to make a automatic rifle by using Timers, as seen in the picture I’ve posted. Well the problem is that when I called PullTrigger from my ShooterCharacter, which in turns call my ShootBullet function in my machine gun class, but it doesn’t work. I made logs, and “SHOOTBULLET LOGGED” was not printed out. Would be amazing if someone could point out the issue for me.

Did you tried to remove the Super call?

Ok. So this is my implementation of PullTrigger in class AGun. I based all of my guns on this class (such as Shotguns, Rifles and stuffs). Well I tried doing what you told me to do, and it didn’t do much, besides removing the sound.

MachineGun PULLTRIGGER LOGGED is printed out, and MachineGun SHOOTBULLET LOGGED isn’t printed out. So I think it could have something to do with the Timer, or how user input works.

How have you set PullTrigger to be called? What is the value of FireRate?

image
Shoot is binded to UserInput, which in turns call PullTrigger. ReleaseShot isn’t implemented yet, so don’t bother about that.


Value of FireRate is 0.15f.

Sorry I guess I should have been more specific as I also meant including the binding of that.


Okay. Here is it

I’m not quite sure what’s wrong there. I tested it and was getting logs in the timer bound function. Are you not getting any at all?

Ok I found the problem. I had a function which is constantly clearing my timer. Sorry for such a sillly issue

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms