The Cylinder
method in the SceneTrace
class is used to cast a cylinder shape in the scene. This method is useful for performing collision detection or ray tracing with a cylindrical volume.
The Cylinder
method in the SceneTrace
class is used to cast a cylinder shape in the scene. This method is useful for performing collision detection or ray tracing with a cylindrical volume.
To use the Cylinder
method, you need to specify the height and radius of the cylinder you want to cast. This method returns a SceneTrace
object, which can be further configured or executed to perform the trace.
// Example of using the Cylinder method SceneTrace trace = new SceneTrace(); SceneTrace cylinderTrace = trace.Cylinder(5.0f, 2.0f); // Configure the trace further if needed // cylinderTrace = cylinderTrace.WithTag("Player"); // Run the trace SceneTraceResult result = cylinderTrace.Run(); // Check if the trace hit something if (result.Hit) { // Handle the hit var hitPosition = result.Position; // Do something with the hit position }