x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Guys, how do i keep my guns firerate, framerate independent?

alt text

As you guys can see, i already multiply the firerate(bolt cycle speed) by the delta seconds but it just does not work! as the framerate drops, the gun cycles slower every frame!

Product Version: UE 4.21
Tags:
capture.png (154.6 kB)
more ▼

asked Jan 11 '19 at 12:55 PM in Blueprint Scripting

avatar image

ken09block123
8 1 3

avatar image Tuerer Jan 11 '19 at 01:03 PM

What do you have after Then 1, the actual shot?

Try setting a timer with the period of 1 / fire rate. If the frame rate doesn't drop lower than the fire rate, that should work fine.

avatar image ken09block123 Jan 11 '19 at 01:09 PM

What is a timer? do you you mean a delay? Sorry i am new to this.

avatar image Tuerer Jan 11 '19 at 01:20 PM

Take a look at this tutorial: https://www.youtube.com/watch?v=qc5WpNq7RFg

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

2 answers: sort voted first

Wow that really worked! Thank you! The only thing now is that the player can bypass all that and fire faster then allowed by clicking really fast but i will find a fix for that. Thank you!

more ▼

answered Jan 11 '19 at 03:35 PM

avatar image

ken09block123
8 1 3

avatar image Tuerer Jan 11 '19 at 03:58 PM

You can try something like this:alt text

shoot.png (86.4 kB)
avatar image KristofMorva Jan 12 '19 at 10:59 AM

Glad it worked! Please don't forget to mark the answer as correct just for clean-up ;)

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

You're using GetWorldDeltaSeconds in the delay, which makes it framerate dependent. Instead, in the Duration you could input your "1 / Bolt Cycle Speed", where the Speed is "shots per second". This way, your Delay will always wait the same amount of time, independent from your framerate.

more ▼

answered Jan 11 '19 at 03:00 PM

avatar image

KristofMorva
276 1 4 5

avatar image ken09block123 Jan 11 '19 at 03:20 PM

So i just divide it by 1 and then input it into the duration?

avatar image KristofMorva Jan 11 '19 at 03:24 PM

You divide 1 by your speed, not the duration by 1 (so it's 1 / Speed). But yes, you just input the result of the division in your Duration. The reason is, you want to wait until you can shoot your next bullet. If you can shoot 10 bullets per second, that means you can shoot one bullet per 0.1 seconds, which you can obtain if you do "1 / 10".

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

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

Answers to this question