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"

Issue with Tick vs SetTimerForNextTick

Hi all,

I've recently been using a workflow I'd created where I can avoid calling functions in main tick, by just contextually setting Timer for next tick.

Tick (empty) Start Mechanic function (from input) - start mechanic calls next function towards end. DoMechanicSimulatedTick (runs stuff whilst mechanic is active such as SetActorLocation) EndMechnic

The simulated tick function is literally just a function that runs, and then if it's still eligible to run, it set's a TimerForNextTick of itself on this actor.

However, I've noticed that if I use this workflow, SetActorLocation becomes choppy.

If I just comment out the line for setting a timer for next tick, and remove the call from the start mechanic function, and INSTEAD check the mechanic state and then run the Simulated Tick Function from Tick, it is smooth.

Anyone know why this is happening? "What Do?"

Thanks in advance

Product Version: UE 4.21
Tags:
more ▼

asked Apr 25 '19 at 04:51 PM in C++ Programming

avatar image

AgentMilkshake1
285 13 18 33

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

1 answer: sort voted first

Never mind!

Turns out that this workflow is flawed due to the fact that all timers are invoked between PostPhysics tick group and PostUpdateWork (at least according to the documentation here: https://docs.unrealengine.com/en-us/Programming/UnrealArchitecture/Actors/Ticking)

This means that the set location of the actor doesn't work smoothly because the physics has already been calculated and it doesn't seem to like/agree with that update happening so late.

I've just moved it all into a switch statement instead within Tick - works perfectly as expected.

more ▼

answered Apr 25 '19 at 05:26 PM

avatar image

AgentMilkshake1
285 13 18 33

(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