I’m creating a skill that spawns flat object at the target location (which is gotten from LineTrace).
It must act mostly like portals(in terms of placement on surfaces) from Portal game, but I’ve expirienced some problems.
Try to Adjust Collision from the SpawnActor gives no result, so shooting in the lower part of the wall results in collision or in non-spawned object(depends on Collision Handling Override state).
What I want is to adjust spawn location to prevent collision.
How to prevent collision when placing actor?
How to check if the target surface is flat and have bigger size than an object?
Here is current piece of blueprint that works with placement:
As you say the Spawn Actor From Class node has build in checking if you wish to use it, but unless you want to go into C++ to work with their spawn avoidance system, the best approach would be to create your own check function, and set your spawn actor from class node to Always spawn Ignore collision.
For example, you could do 4 line traces for each corner of your object to check if the floor is a valid location. You can compare the impact normal against the other line traces to see if they are flat surface.
Is there a reason you have collision enabled for gameplay? Could you use overlaps instead of collisions to detect interactions? By using overlaps, you would be able to spawn in your desired location and then handle any overlaps as needed in the actor itself. No special spawning code would be required then.
Well, technically I can, but I can’t see how exactly it will help.
Overlaps never fail to spawn. If this is a skill the player can use then my assumptions is that this applies some kind of damage to other players, allows the player to perform some task, or acts as a visual placeholder for gameplay related events. If all you need to know to make the skill work is when someone is interacting with the volume then overlaps work more efficiently and are less problematic than collisions from my experience.
I only use collisions when it is needed, otherwise I use overlap behavior as it saves me a lot of headaches in the long run.