Hello,
I'm a non-coder having some success with Makinom, but struggling with raycasts and selected data (I don't quite get it). I read the tutorials, but there was not enough there to help me understand. Could a Makinom guru walk me through using a raycast from an object to spawn a prefab at the hitpoint of the ray against a collider, and print the name of the object hit, and coordinates of the hitpoint? I can get a raycast to come out of the end of a pistol, and trigger a tagged machine on a unity cube with a box collider (I can print "object hit" to the unity console when an object is hit through a tagged machine), but I can't figure out how to use selected data to spawn prefabs at the intersection point. I don't really understand selected data use. Like what is the difference between data key and variable key, and data origin and variable origin? And what do I put in the drop down to the right of the note-pad thing, when Makinom asks for a variable key and a data key? When do I put "value" in the drop down vs. "variable/selected data" or "game object"? I think I need a "for-dummies" type of explanation. Thanks to any who can help!
- select the Local variable origin (since you'll probably only use this in the running schematic)
- enable Store Hit Point
- define the variable key (e.g. hitPoint)
- select the Set operator
To spawn the prefab, use a Spawn Prefab node (e.g. connected to the Success slot of the Raycast node):
- select the Prefab you're using (set up in the Settings node)
- select the Position target type
- select the Vector3 Variable Vector3 type
- use the variable key you defined earlier (e.g. hitPoint)
- select the Local variable origin
I don't think it's currently possible to print the name of a selected data object in the console, though.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
The hitPoint should be shared with the tagged machine - make sure you're using the correct variable key and origin in both schematics.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!