I know you have to use Raycasting but for the life of me I cant figure out the proper combination of conditions and actions. You have to use Raycasting because the regular methods of collisions dont test against 3d model Mesh, only the bounding box, and usually those bounding boxes on models arent accurate at all. But the Raycasting tests against Meshes (the actual model) , So Can someone give me an example of 3d raycasting collisions?
Something like
Cast ray from center camera → If raycast hit 3d model object, then give collisions somehow
But, since I cant figure it out, i’m instead painstakinly creating 3d box sprites around EVERY 3d model to give collisions that way, and its very arduous and not efficient. This raycasting method must be much nicer, but I cant get it working.
Thanks
This is how I was told to do it, it is SUCH a time saver
1.) Go into events, add a condition and select the 3d model you want to collide with.
2.) Select the “Raycast to Position” and then type the respective coordinates of the player (Example: Ray Source/Target X Position: Player.X())
3.) Choose a Ray Target either XYZ, (in my case the Z axis to stand on the object) and insert a number (In my case a positive number above 1000).
4.) Add an action and choose the Player/Camera object and the respective coordinate action your operating with using XY positioning (Or in my case the Z (Elevation))
5.) Set the Modification Sign to “=” and the Value to Raycaster3D::Intersection, you’ll be shown three options, either for the X, Y or Z coordinates
Major thanks to user VENJII for telling me this!
Thanks, but I’m still stuck. Can you send a screenshot? I cant find the panel to line up to what youre describing.
There are two raycast options
“Raycast to Position”
&
“Raycast to A position”
Slightly different input boxes. Which one exactly did you mean? I assume the first, but idk.
And I’m stuck at step 3, I dont know what to put where now.
do you mean put Camera.Object3D::Z() +1001 in both target boxes?
What do I put in the variable boxes?
This is the Condition
This is the Action
The Condition “Raycast to Position” is for 2d while “Raycast to A Position” is for 3d.
Thank you very much for replying and showing examples!
Unfortunately I still cant get any useful results
Here is a video showing my issue
At best, I can make the character bounce while he hits the fence, but I cant seem to give it collisions somehow.
https://i.imgur.com/Idek2la.mp4
What do you think should be tweaked from here to make it so he cant walk through the fence?