Optimisation is a huge topic:
But, even if executed perfectly, it will not save you from inherently bad scripting / coding practises.
[…] adding new variebles […] multiple castings are toward the same actor at exactly the same time, will that cause any issues?
Should not be a problem. On the other hand, consider avoiding:
- casting on Tick
- unnecessary Tick logic
- long blueprint loops
- widget function binding
- getting (all) actors of class
- manual garbage collection
- spawning and keeping a huge number of actors / widgets alive
- spamming delays
Try to employ:
- an event driven approach whenever possible
- soft references
- object pooling
The above is super-generic; no clue what you’re up to.
I started to notice some small issues that never happened before
Like what? It’s pretty impossible to advise without concrete details.