Hello everyone!
Recently I’ve been working on my project. I tried to use new function called “Shapecast”.
So, I wanted to make when you jump, you jump inertia and if you hit something you would stop moving.
I did jump inertia and stop when you hit walls. Yes, only walls. When I try to hit something else… well… I crash.
Here is the clip of it:
Am I doing something wrong or it’s a Shapecast bug?
In short, spherecasts are not that performant especially if you are running it in a loop. I experienced this in my game where it would immediately crash when it loaded because of spherecasts. I had to switch to just using regular raycasts after that.
I think it’s also weird that it’s only happening on objects other than walls. Can you provide a snippet of code that shows this spherecast?
Sorry for the late reply, wasn’t at home all day but here is my code:
local hit = false
while is_flying do
RS.RenderStepped:Wait()
if not hit then
--local result = workspace:Raycast(hrp.Position,jump_direction_3d*1.5,raycastParams)
local result = workspace:Blockcast(hrp.CFrame,hrp.Size,jump_direction_3d,raycastParams)
if result and result.Instance then
jump_inertia.PlaneVelocity = Vector2.new()
hit = true
end
end
end
(Comment is just raycast usage)
And seems like shapecasting is not a good option when it comes to loops.
I didn’t steal the map, just a placeholder, you can get it for free from toolbox. And from what I remember hudzell said that he doesn’t own the first version of the map.