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"

Changing Actor Tick Interval while running

About the new 4.9 Actor Tick Options.

How can i change the Tick interval in Blueprints while the game is running.

Under Utilities I can only enable or disable an actors tick. Is there a way to change the Tick Interval while running ?

alt text

Product Version: UE 4.9
Tags:
more ▼

asked Sep 12 '15 at 01:37 PM in Blueprint Scripting

avatar image

Gaara
51 2 6 11

avatar image bertywerty Sep 12 '15 at 03:00 PM

You could always add a condition after the tick that says something like;

When running, only perform the rest of the blueprint after 10 ticks. This will have the same effect as increasing the tick interval.

You could do this by incrementing a number every tick, then when this number equals 10, perform your blueprint actions then set the number back to zero.

avatar image jejunus May 06 '16 at 02:27 PM

out of curiosity, why not use a timer?

avatar image jgosztyla May 21 '19 at 01:18 AM

I have found this does work, with some limitations - namely the interval only takes effect after the next tick. For example, if you have your tick interval set to 5 seconds, and 1 second into the tick you set the interval to 0 (to tick every frame), you still will wait 4 seconds for the next tick, and then after that the ticks will occur every frame.

This isn't so much a problem when you are setting the tick interval higher, but obviously this causes problems when you are trying to shorten the interval.

To fix this issue, you can disable ticking, set the shorter interval, then re-enable ticks (I'm in C++ here.) For an occasional tick change this isn't a problem. However, if you are trying to vary the tick interval continuously you can run into some issues with this approach.

-jeff

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

My solution...

In my utilitiues .h file

 UFUNCTION(BlueprintCallable, Category = TDLHelpers)
     static void TDLChangeTickInterval(AActor * actor, float newInterval);

 

And in my .cpp file

 void UtdlBlueprintHelpers::TDLChangeTickInterval(AActor * actor, float newInterval)
 {
     if (IsValid(actor))
     {
         actor->PrimaryActorTick.TickInterval = newInterval;
     }
 }

All tested and works great.

Then in my NPC actor blueprint on the tick I check the distance to the nearest Player and calculate the interval for the next tick. We use (so far) 1 second per 5 meters linear, clamped to 0.25 to 10 second range.

more ▼

answered Sep 19 '15 at 02:20 AM

avatar image

SND R Keene
968 31 120 113

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

You can't as that property i only for EditDefaultsOnly and don't have any blueprint interactions on and there seems to be no functions associate with it

https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/Engine/FTickFunction/TickInterval/index.html

Normally this means variable change does not have any effect in real time and it's only relevent during initiation... but if i read source right this is not the case here, but i'm might be wrong. But if it works during gameplay then for now it's only via C++, you can easily make node for your own.

more ▼

answered Sep 12 '15 at 03:07 PM

avatar image

Shadowriver
36.6k 932 169 1111

avatar image Gaara Sep 13 '15 at 03:30 PM

Thanks you for answering. Guess i am going to wait a bit until it will be implemented

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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