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"

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?

Product Version: UE 4.20
more ▼

asked Oct 01 '18 at 03:18 PM in C++ Programming

avatar image

8 3 5 9

avatar image birdfreeyahoo Oct 01 '18 at 03:30 PM

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?

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

1 answer: sort voted first

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 :)

more ▼

answered Oct 01 '18 at 03:52 PM

avatar image

8 3 5 9

avatar image birdfreeyahoo Oct 01 '18 at 05:23 PM

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.

avatar image Slavical Oct 01 '18 at 05:35 PM

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?

avatar image birdfreeyahoo Oct 01 '18 at 05:36 PM

Of course.

(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