However do you know then we’ll eventually be getting margins? After all, it was you guys said you were going to add margins in the first place. You also said it would be parallel with Shapecast, We’re still hearing that margins are on their way. So, any idea when they might actually arrive?
this may sound stupid, but i feel like shapecasts should give multiple hit results, like returning every part that is in the way of the shapecast instead of stopping at the first hit, is there a way to do that or do i have to create multiple shapecasts?
THIS. I want to use shapecasts as a far better version of how I previously did NPC viewcones. But, them only detecting one object makes this almost impossible.
The issue would be this, so I want the zombie to detect if he can see the player. With this fence, we would automatically assume the zombie isn’t seeing the player.
If this is a Union/Mesh or anything else, is hard to know when to determine if it should ignore the object or not. Right now the only thing I can do is tag every object, so it is ignored by the Raycast, which is very tedious.
This is what I want it to do, it would be a very different type of Raycast indeed, but it can also be useful to determine if a point is safe to walk up to when there is a bit of something dangerous around a part that you want to detect.
If there is a better way of doing this, can you let me know? (Do not focus on these examples only, imagine a whole game with a lot of details with broken walls, tiny holes here and there, meshes that allow you see through them, in short, many types of objects all around with geometry that still allows you see through like a fence).
Don’t forgot about regular RayCasts. They will perfectly solve your problem with zombee and fence. Yes, it may have flaws, but it will solve them if you TRY to fix them.
About lava:
I don’t really understand what you wanted to tell there. You need detect if there’s lava nearby? And what lava is - terrain material, part or smth else?
I know but is like the old way of shooting like 40 Raycast to check if a player is there.
About the lava, it could be fixed doing tons of regular Raycasts as well. I just wanted to know if lava could be possibly reached accidentally by the NPC to avoid that area.
Anyways, that’s why the people above asked for a way to let the cast to continue and grab all the possible parts. But anyways…
Cuz the shape casting, seems really good until you see it hits a tiny, really tiny edge and that’s how it goes to waste. (Depends on the use-case of course)
But raycasts are still more efficent and less time consuming than shapecasts (x3). local start = os.clock() for i = 1, 10000, 1 do workspace:Spherecast(Vector3.zero, 5, Vector3.xAxis * 1024) end print(os.clock() - start)
Sphere cast 10000 times consumes 1.6 seconds local start = os.clock() for i = 1, 10000, 1 do workspace:Raycast(Vector3.zero, Vector3.xAxis * 200) end print(os.clock() - start)
I expected diffirent result, but this took 0.55 seconds
Strange result btw, increasing LENGTH of ray/shapecast will increase processing duration for both.
I don’t expected shapecasts be so better than I thought.
About lava - if you don’t want to allow NPC go into it, just use weighted pathfinding? Or if you need just value if there’s any lava nearby use GetPartsInRadius() or how it called.
Awesome update.
One thing that would be nice if it were clarified - does the accuracy of a shapecast change with a mesh’s CollisionFidelity? If so, would that mean that Box or Default would be more performant than Precise?
Remember that raycasts are a simple 1-dimensional beam whereas shapecasts are 3-dimensional. A difference of about 3x speed between the two seems understandable.
You should use codeblocks when posting code snippets. There’s a nice guide for formatting posts here
I not expected shapecasts to be only 3x slower. I expected them to be much more slow, bc of collsions checking?..
Also, I typed codeblocks like this because code was typed in command line and meant to be pasted into it too. Codeblock will make “scrollbar” which are not very comfortable with long strings.
For your fence problem, I suggest that you create a collision group for all BaseParts that you want your zombies to be able to see through. You can then use this collision group in a RaycastParams and blacklist the collision group you made, and you can use the RaycastParams in your raycasts.
Is there any plans for an specialized and perfect “CapsuleCast”?. Sure you could kind of make a capsule cast with a couple shapes, or maybe with a capsule mesh, but it would be great to have a special Capsule shape. Most engines like unity/godot/unreal has an specialized CapsuleCast casting, it’s used a lot on kinematic movements
that’s cool and all. but when will animation stuff get fixed so the “Sanitized ID” error doesn’t show for every animation anymore and a lot of toolbox models using animations get fixed?