Hi, I'm trying to implement the Dash ability on my character. Each time I press the button Dash, the character jumps forward 3 units. To keep him from going through walls and to detect the presence of enemies, I used a boxcast. The problem is that I can't see it in editor, like a Debug.DrawRay. Then I was wondering if it was not the same thing to use a box collider as a trigger, put as a child of the character, moved a little forward so it can trigger an event every time it collides with something. What do you think? Is it a possible alternative to the Boxcast? Thank you
Boxcast will be more efficient. The documentation for boxcast has an example of how to visualize the box with a gizmo in the editor. Scroll to the example code at the bottom: https://docs.unity3d.com/ScriptReference/Physics.BoxCast.html
Ok. Yes I had seen the example and I was able to replicate it in Bolt, using on gizmos event. It made me struggle but I succeeded. However if you say that Boxcast is better, I trust you! Thank you
If efficient mean performance you should profile, else you should try both anyway, I always a have a unity project to test throw away idea without messing teh main project.