I hate to be annoying but would you be able to elaborate on that? So far I’ve been writing this whole function in construction script.
Because I’m wondering if that would that be a new function I write in bps or would that be one of the default events like “On Component Begin Overlap”?
I’m trying to make this run as fast as possible so all my meshes are very simple with just a single capsule collision but for some reason that static mesh collision doesn’t seem to carry over. But they have to have some kind of collisions as my actors do pathfind around it oddly enough.
This sweeps a sphere towards the ground from above, if it hits the floor, that’s good (green) - it means there was nothing in the way and you can spawn your thing. If it hits something else than the floor (red), it does nothing.
I slowed it down to 5/s so we can see it. Pretty sure this can be run faster with instanced static meshes.
Disclaimer: this is not really an algorithm per se. This is just brute force. I’ve been looking at circle packing and sobol sequence recently. There’s some really cool stuff out there. Sobol is in the engine but there’s no documentation for it
It does not seem to be set up right at all. And you’re not checking for the correct hits either. Perhaps stick to what I posted for now and get it working and then expand, as you will most likely want to improve it later on anyway since this is rather crude.
1000 is how far above the ground we’re shooting from, this value needs to be greater than the highest ground elevation so the beams have room to travel down.
(-Z 2000) - this is how far down we’re going, if you have undulating terrain, this value has to reach its deepest crevice. Do note we started from +Z 1000, the beam length is 3000 in total here.
and you need to trace vertically down, at the moment you’re just hitting the middle of the world with every beam.
And most importantly
You’re not comparing the results to anything, meaning that things will always spawn - you’re just checking whether there was hit. You need to find out if you’re hitting the ground (good! - spawn) or something else (not so good! - do not spawn).
There are many ways to achieve that, I chose to give the ground mesh a tag and check whether what I hit has a tag.
I’m wondering if thats a possible side
effect of them not having collisions?
You do need collision for this method to work, a simple box will do. You can always switch off collision once they’ve all spawned if it’s not needed during gameplay. Btw, I just tried it with HISMs and it is, indeed, faster than spawning actors!
I don’t follow; the static mesh that is being used as a source for the hism component already has a collision setup. At first a capsule but changing that to box collision doesn’t change anything.
I have use simple as complex enabled if I drag and drop the static mesh into the world I can see the collision but if I spawn the hisms through the bp we’ve created I can’t see any, now their collisions are set to block everything and it does block my camera and pawns, yet the system doesn’t seem to be able to tell when they overlap.
Yeah I switched to for objects because I think it’d work better as I have the hism set to not block visibility, camera or landscape.
I watched a couple tuts and from what I’ve seen if you set it up to use the same number it will make a sphere in a radius around it, but it needs some sort of number so it can still sweep, thus the 0.1 on the z.
I honestly don’t know enough about trace to be able to really even understand what to do with the end otherwise cause my level is 100% flat on the z=0 so it doesn’t even need to be anything…
And so far it does work they just keep colliding I can mess with the end point but I don’t know how that effects it. I did have a get class > = landscape before which worked but they still collide.
Okay so I’ve been watching tuts and reading some documents on it this should work in theory but no matter what combo I try with the red square they still overlap.
If I check the hit actor is landscape, the HISMs, actor tags, component tags, nothing will work. Is this bug report territory or is there some reason the HISMs are still spawning inside each other? The only other way I could thing of is have to variables that are the last HISM’s transform and check that vs the next one’s.
The source mesh definitely has collisions and the HISM collision channels are def setup correctly.(But the collisions on the HISMs still refuse to show.)
Well the main problem is I’m getting confused about what actually goes into the end on that. I’ve watched some trace tuts and if you keep the start and end the same it should trace a sphere around it. But it needs some sort of number to sweep, correct?
Cause if my landscape is 100% flat I don’t need to check the z by 2000? Shouldn’t it just be the x,y?
My objects are set to block everything except the camera, visibility and landscape I have a custom channel called “resources” that the trees are a part of(resource blocks other resource).
And I’m reluctant to use the trace by channel because I need these things to not block camera, visibility or landscape.