My Player Character has the ability to spawn four “clones” of itself with a key trigger. All clones spawn successfully except that atleast one of them falls through the map. That’s either falling through the floor or falling through a static mesh (eg. steps). I’m using the ThirdPerson Template map and my clones are exact copies of my Player Character’s collisions, mesh, etc save for having an AIController. I tried tweaking the collisions in the SpawActorFromClass node and that didn’t seem to help. Both the clone and Player Character’s MESH components are set to CharacterMesh. Below are the settings for the capsule components.
alt text
Hello! You can try to
- Tweak Physics settings in Project settings (https://www.reddit.com/r/KerbalSpaceProgram/comments/1ruodr/max_physics_deltatime_per_frame_setting/)
- Use CCD mode for capsules collision (Set Use CCD | Unreal Engine Documentation)
- Check collision thickness of floor if you modelling it as plane or landscape (Landscape Collision Guide | Unreal Engine Documentation)
You’re spawning the characters in a spherical random location, thus you’re getting random values in Y as well. Guessing you have at least one clone that spawns below the floor ever so slightly.
You could try grabbing the Y position of your current player and explicitly overriding the Y with the position of the main character and then combining that with the X and Z values of the random position.
If your landscape is not flat within the specified radius of your random sphere location you would then need to figure out the proper height at whatever distance from your player character will be otherwise it will still fall through the floor.
thank you! i have to try these out. will get back between now and tomorrow
ha yes i actually have couple clones that spawn inside the stairs under me. when you say current player, do you mean the clone?
could you give me example code snippet?
Hmm ok. this is my first time going further in depth with vectors. will try this in my code
No, I mean you have the current actor location, you can use its Y position and then override the random’s Y position.
You could also try spawning them quite high and using a line trace straight down to find the floor then repositioning them at the hit location.
that sounds even better. I don’t think I’ll need the line trace though. Only because when they spawn at a location they already naturally space themselves b/t eachother. I think it’s because I have RVO avoidance on. I def try to spawn them from above and see if that helps. Gracias
Woo! Solved it. I offsetted my Clones’ locations from my Player’s so that my clones don’t spawn too far away nor right on top of them! They still spawn close to each other. Simple fix to my problem albeit not fancy! thanks for everyone’s help
alt text