UE4: C++ Actor Tick Problem

Hello there,

I am having an issue where I have an actor rotate base on delta time from tick. I notice that tick doesn’t increase, it stays at a certain point and my actor will not rotate correctly. My actor seems to be sticking at 90 degrees rotation, can someone explain to me why C++ deltatime is not advancing?

I see, Is there a tick method that allows me to rotate a object over time?

or even a variable?

I was trying to multiply the deltatime with a float value to get a new number and add it to the actor, but it was giving me weird effects.

Here is my code:

    FRotator curRot = GetActorRotation();
    float deltaRot = DeltaSeconds * 50.0f;

    if (curRot.Pitch >= 360.0f)
        curRot.Pitch = 0.0f;

    SetActorRotation(FRotator(curRot.Pitch + DeltaSeconds, curRot.Yaw, curRot.Roll));

Thanks for cleaning up my code! :slight_smile: but unfortunately It is still stopping 1/4 of the way there. Rotates 90 degress and stays there. Maybe there is a better way of rotating the actor without my way?

also if there is a way, i would like to show you my cpp and .h file

There we go. Tell me what you think.

link text

I have a txt file that has my .h and .cpp file. can you have a look and see if there is anything else?

link text

That is fine. I do have a backup of how to do some rotation, but I was really pushing forward with manual rotation. the other way I had in mind is using a timeline and return a float off of that.