I just made a variable with actor object reference in it
Creating a variable does not instantiate the actor. Where is the my child actor flashlight instance? How does the player know which actor instance we’re talking about?
Not sure what you referring to. You asked how to access data inside an instance of the flashlight blueprint but here you’re showing how you destroy it.
im trying to cast the flashlight but somehow nothing is happening. please help
How does the player know which BP instance this is? Imagine there are 10 flashlights. How are you going to assign one of those flashlights to be referenced by this very variable?
The inspect part is partly finished. And I only have the destroy item on the pickup line.
The flashlight I want to turn on is just a spotlight connected to the player camera and its visibility turned off, My plan is for the player to get the variable “Flashlight picked up” after interacting with the flashlight I placed on the level.
Im not planning to place more than 1 flashlight. so it didnt occur to me to choose what flashlight is being picked up. all the items in my game are just a child of the Parent blueprint with the inspect and destroy item code.
On the flashlight Item child blueprint. I just override the destroy item custom event on the parent blueprint. and Added a boolean variable that checks true after getting destroyed.
Sounds good. So we’re not really picking anything up per se. There can be no actor to cast because the flashlight actor gets destroyed, right?
only thing Im really confused is how to set the variable Actor object reference to get the boolean “IsFlashlight picked up”.
There seems to be no need. What if the player had the variable IsFlashlight picked up → set it True when you pick it up.
player line traces against world objects → interface message to interact (you got this already)
the interface returns some data regarding the object (or you can even have the flashlight set the player’s var before it gets destroyed - not ideal, though)
the player can use the data interface returned to manipulate its own variables