Wouldn't casting only once be better

In this lesson we are doing a anim blueprint and for that, casting on animation update. Wouldn’t it be better if we only cast on Begin Play?

It depends, but in this particular case it would be better from a performance standpoint to cast once in Begin Play and store the result as a variable.

You still need to check velocity in the Update Event, though. I would also recommend using an IsValid node to check if the object reference in the variable is valid (can lead to weird initial behaviour on Play).

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms