#Wall check

1 messages · Page 1 of 1 (latest)

upper saddle
#

Hello! Me again X2

I need a solution to the problem of checking whether there's a wall/object near the player at ANY height.

Previously, I used a crappy check with a radius fan of Raycasts.

Now I want to change that. I don't think there's any point in adding anything other than mentioning that this is a 3D game and there should be multiple triggers for checking.

What's the best way to detect walls around the player? I understand many people will recommend Overlap, but there might be something else. That's why I'm not Googling but asking people.

quick flax
#

whats wrong with casts?

#

imo is the best methods

pine cradle
#

typically there's 3 ways for detection in general

  • colliders
  • triggers
  • queries (casts/overlaps)
upper saddle
quick flax
pine cradle
#

why not use boxcasts, or cast the collider shape

#

uh if that's a thing... i don't remember if that's available in 3d

quick flax
#

You can literally cast as big sizes as you want

upper saddle
#

As far as I know, there are only capsules and boxes.

But what if I want to increase the radius?

pine cradle
#

the radius of checks?

upper saddle
quick flax
#

and most cases the basic shapes is al you need

pine cradle
#

you would increase the length of the cast then

upper saddle
pine cradle
#

you're confusing the size and the length of the cast

upper saddle
#

Okey I will try explain what I am looking exactly for

pine cradle
#

the size controls the initial shape
the distance controls how far that initial shape goes

upper saddle
pine cradle
upper saddle
#

Look

I have a player. The player can dash.

**I'm looking for a way to check for collision with objects and increase the radius around the player only along the X and Z axes. **So that the dash isn't dependent on the ceiling or other crap above.

That's why neither boxes (the radius isn't adjustable properly) nor capsules (if you adjust the radius, the height eventually increases) work for me.

And I'm looking for something like a cylindrical check.

pine cradle
#

you are mistaken about radius of the check and radius of the shape used for the check

#

the size of the box/capsule/sphere is controlled separately from the distance of the check

#

this is a cast, not just an overlap check

upper saddle
#

So actually I can use capsules for this?

#

As cast

quick flax
#

yes

#

isnt your player a capsule anyway

upper saddle