Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

Craft raycast and spherecast

dave1707dave1707 Mod
in Bugs Posts: 8,206

@John @Simeon There a bug in the documentation for spherecast. Both raycast and spherecast have lower case c's in cast. To code spherecast, you have to use sphereCast with an upper case C. I think both should have an upper case C, rayCast and sphereCast and the documentation updated. Another thing I think is a problem is with the two rayCast and sphereCast parameters, direction and distance. Apparently the direction values need to be multiplied by the distance value. For example, if the origin is at 0,0,0 and an object is at 0,0,20, if the direction is given as 0,0,1, then the distance needs to be 20 for it to work. If the direction is set at 0,0,2, then the distance only needs to be 10. If the direction is 0,0,10, then the distance only needs to be 2. Shouldn’t the direction and distance be independent of each other. At least that’s what I’m seeing in test code.


  • JohnJohn Admin Mod
    Posts: 605

    @dave1707 That sounds like a bit of a bug. Personally I prefer using all lowercase (as in spherecast is just a compound word rather than 2 words). The direction vector should be normalized so that's a problem too. Thanks for letting me know.

Sign In or Register to comment.