So I have a drone system for my game, the deploy drone logic is handled in the character BP, where it unpossesses the character and possesses the Drone BP, it’s using a spawn actor from class to create the drone, then posses it .The drone BP has a battery power and drain function. When the character pushes a button the drone disappears using a destroy actor node and returns possession to the character BP, or when the battery level reaches zero, the same code is fired. My problem is I’m trying to add logic so that if the drone previously reached zero battery and gets destroyed the player can’t deploy the drone again until using a battery to re power it.
I’m fairly certain my problem is stemming from the actor being destroyed and a new one being spawned in afterwards, although I’m not sure how I can work around it. I don’t really want to have the drone in the level until the player pushes the button so it simulates like being pulled from a backpack and deployed.
Presumably you alresdy have a ref to the character in the drone for when you reposess it, before destroying the drone just use that reference to set some variable in the character
If you dont have a reference to the character its fairly straightforward, in the drone just have a character variable and click expose on spawn, then in the character bp when you spawn the drone youll just pass in self, and then the above should work and you can pass back the information
Ok Thank you very much, I’ll give it a shot, I think I do have a character ref but am fairly certain it isn’t exposed on spawn.