Spawn Actor from Class

Hello, I’m new to unreal, I’ve created a weapons-picking system, and I have a problem with laying the weapons, I duplicated some weapons and created a variable class to spawn the weapon I got, so when I try to spawn, nothing happens . help!!

264602-img-5.png

they are in the same class, they are children of the same father.

for me i use a blank parent actor with a structure of all the details including class and then write all the code in the main and pass it to the children class and it works perfectly if you want details let me know

doing so worked perfectly.

doing so worked perfectly.

That way I got this back, I wanted me to return the guns for the class. I must be doing it wrong. Sorry for my English.

It is good practice to store the spawned actor reference instantly in a variable so you don’t lose track of it. Something like this:

It greatly helps readability and debugging.

In any case the “Accessed none” messages indicate that things did not go perfectly at all. :slight_smile: It could be that the spawn location is inside colliding geometry. Using a shape trace (Traces Overview | Unreal Engine Documentation) you can check that the location you intend to spawn the actor has room for it. Or for a quick hack you can just set the Collision Handling Override param to “Always spawn, ignore collisions” and see if that helps.

Thanks, it worked.

Does the output log show any warnings or errors related to spawning? Is the return value of the SpawnActor node empty? If not then are the location and scale values what you’d expect?