I added some weighted rng loot drops to my game but for some reason i can’t make it spawn where my enemy die. I have the loot functions on an actor component then by adding the actor component to my base enemy BP seems to work pretty well. The loot drops as i set it only not on the location on which it is set (location of the enemy).
I was trying to get world location or actor location from there to my base enemy bp but it didnt work. I had some success on putting the drop logic directly on the enemy bp but the rng loot didn’t work… Can i somehow get the location of the mesh of the enemy bp or capsule component and use that as a drop location on this actor component somehow? I awso try to "set the location " in the enemy bp and then getting it on the actor component but the loot aways just drop at 0.0.0 location
Is just a reference to my main enemy bp. From which all my enemy’s are child of. Not sure what else to do. I was trying to SET a capsule or mesh location on this base enemy bp and then was getting this location on the actor componenent but it didnt work…
I assume LootTable is a component assigned to BP_MainEnemyClass. Right? So there should be a GetOwner → Cast<BP_MainEnemyClass>() → MainEnemy in BeginPlay.
GetActorLocation node returns a zero vector if the reference is null. So we need to check if its being set correctly before anything else.
Hmm im not sure if this is right but its working still have 1 bug with it. It picks only 1 actor when i have 10 and spawns all the loot only on this one actor… I guess my setup isnt right yet…
lol yeah even this works now … I previously did exactly this as the very first thing and it didn’t work. But i had “get owner actor” and not “owner actor component”. That would have fixed it from the beginning. Oh well now i learned something new so hopefully i don’t make this mistake again. Thx a lot