Where to Calculate Character Rotation Logic

So lately I have been calculating my character rotation logic within the forward axis event inside my character cpp file because I try to avoid using Event Ticks as much as possible. I place the rotation logic within the cpp file because, with my understanding, the cpp file should control the movement and rotation of the character and the animation bp should focus on playing the animations based on the updated logic from the character cpp file. In other words, the cpp file feeds updated data into the anim bp, and the anim bp plays the anims associated with that logic.

My question: Is this the the “correct” way of updating the rotation of a character on every frame, or should the logic really be placed in the Event Tick? Or is using a timeline that fires every 0.1 second more efficient? Or is there some other method that is most commonly used within the industry?

Why you use the Forward Axis Event? Is the rotation controlled with this axis? How does the rotation behave, i.e. is it controlled by the user or like a linear spinning thing?

Well it does depend though, but if it is a continuous rotation I would definitely take the tick event, because you will see change in every frame, which is necessary to have a lag free perception of the rotation. If it only rotates in discrete steps you can work with timers (at least in C++). But for a simple rotation I wouldn’t worry about performance.

Of course.

Yes it is a continuous rotation because the rotation is based off of the player’s input. So if the player moves the camera, the character skeletal mesh will rotate towards the camera. I am creating my own rotation instead of using orient rotation/use controller rotation that’s built into the character movement component.

So would event tick still be viable in this scenario?

Well you have to update the rotation very frequently. You need Tick or something similar. I consider tick to be the best option, because you have the right rotation each frame then. If you implement it simple as it is you shouldn’t be able to see any impact on performance.

I place it in the the axis event instead of the event tick because I use the forward axis event as a replacement for the event tick. I do this because of the many posts I’ve read and the ue4 video about optimization that have urged others to avoid event ticks as much as possible, however, this approach at avoiding the event tick by placing the logic inside an axis event doesn’t seem appropriate, hence my question :slight_smile: