Q.Way to store Reference

so, it’s convenient but i wonder is
this ok? is there probably Problems?

I would not call it convenient (perhaps in a tiny project it could be) but there should be no problems if you’re treating them with care. This is not a great practice in the long run and there is generally no need for this if you set things right.


Now that you know how direct references work, perhaps look in to Event Dispatchers. And then into Interfaces. Once you see how these work, you’ll notice how redundant / dangerous and unnecessarily complex storing direct references can be.


Imagine what happens when you have 1051 puzzle blocks in the Level Blueprint. Let’s say they all need to talk to the Player Controller but you probably don’t want to crate 1051 references, right?

Instead you could have an event in the Player Controller:

330244-event.jpg

And in the Level Blueprint:

Notice that there’s not a single hard direct refence here, yet every time I click the actor, the controller is notified and knows precisely which actor was clicked and with which button. And if one of those actors gets destroyed, no biggie; no error messages, no null pointers.

Try destroying a hard-referenced actor and access it again, see what happens.


Essentially, there is no one way of communication. You pick the best tool for the job.