So I’m having a problem with spawning actor on hit location. I’m trying to spawn an actor when I click with the mouse, the problem is that hit location gives me exactly the point where I click on the terrain, spawning the center of the actor on the terrain, which will cause an overlap. I found a way out of this, which is putting the relative location of the actor component up, this way the actor component will spawn above the actor. The problem is that this has to be done manually, with all components, and I can’t avoid it when I have to add a component to the actor dynamically.
So I was thinking, is there a way I can use hit location using the actor component collision? Or how do I get a component size so I can spawn it dynamically and then change its location by adding half of its size to the Z location?
Hey there, on begin play you could try to access the static/skeleton meshes of your actor and check the bounds and get the highest Z bound and add that to the relative location.
Thanks, I will try that
Let me know how it goes.