Is it possible to increase the tick rate of a specific actor?

Hi All,

I’m working on some melee weapons which do traces at each tick, and I’ve run into a problem where some animations are very short, which leads to inaccurate collision detection.

I’m already interpolating between the positions at each tick, but the problem is that when an animation lasts only 2 or 3 ticks, the hit detection is quite bad.

The easiest solution would be to have the actor owning the mesh do e.g. double the amount of ticks of other actors.

Anyone know of an easy way to do this?

Thanks.

You cant, tick is called for every frame, it rate depends on frames per secound, tick role is to update actor state for next frame. If you want time based event use timers

or do something with delta time

Thanks for the info, I suspected as much.

For interest’s sake, I’d like to know what would happen if timers are called with a higher frequency than delta time. I suppose I could just test this myself.

For those interested, I solved it by using animation sub-stepping instead.

i.e.

At each tick I record the montage position of the current animation, and then I interpolate the montage from the previous position to the current position.
This is easily done with some of the following basic operations:

// Get anim instance
UAnimInstance* YourMeshAnimInstance = YourMesh->GetAnimInstance();

// Get current montage 
UAnimMontage* currMontage = YourMeshAnimInstance->GetCurrentActiveMontage();

// Get current montage position
const float currMontagePos = YourMeshAnimInstance->Montage_GetPosition(currMontage);

// Set current montage position
YourMeshAnimInstance->Montage_SetPosition(currMontage, 0.5f);

// Update bone transforms so you get correct socket locations
YourMesh->RefreshBoneTransforms();