playMaker

Author Topic: How do you use box/sphere cast properly?  (Read 877 times)

Mupp

  • Full Member
  • ***
  • Posts: 167
How do you use box/sphere cast properly?
« on: August 25, 2021, 04:39:15 PM »
I want to cast a box and a sphere at 0 distance from its object and only use the radius from the shape so it covers the object at equal distance in all directions. But if I set distance to 0 no ray is cast at all.
Also the debug lines for these 2 casts are not helpful at all. It's just some weird lines that doesn't show where the shape of ray actually is.

What should I do?

hoyoyo80

  • Full Member
  • ***
  • Posts: 136
Re: How do you use box/sphere cast properly?
« Reply #1 on: August 27, 2021, 09:38:03 AM »
+1, i remember asking the same question with no reply. Hope u and me can get the solution. Last time i intend to use this as ground check for jumping but have to change to trigger to check the ground

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: How do you use box/sphere cast properly?
« Reply #2 on: August 28, 2021, 09:31:43 AM »
Hi.
Distance 0 will indeed not work

what i do is set size x or y to 0.001 (depending on direction)
and then set distance to what i need (greater than 0)

The debug lines seem to work for me as long as a distance is used.

for sphere cast it will probably work the same way

Mupp

  • Full Member
  • ***
  • Posts: 167
Re: How do you use box/sphere cast properly?
« Reply #3 on: August 28, 2021, 11:41:25 AM »
Yes the debug lines work, what I'm talking about are the lines for the shape itself.