Hi,
I have no idea how to make buildings transparent within the ORK 3 Framework if the player is in, behind or under a building.
Of course I understand that a Raycast can be used from the camera.
Camera -> Raycast -> Objects -> Player
And I understand that Transparent Shaders can be used, or even the Renderer can be used.
And I know that in the Schematics there are Raycast nodes.
But I have no idea how to use it for this. Not even a clue how to link a Schematic to a Camera. There are so many different Machines to link to an object, and Schematic Nodes that I have no clue where to start.
Isn't a tutorial available for this? Not even from ORK 2 (of which I found the Event system a lot clearer than the current one with all those new terms)?
For example, I converted the Removing Walls tutorial to ORK 3, which is doable after puzzling.
So you can give a brief (or better: more detailed) explanation of:
- how do I make a schematic with Raycasting for this purpose
- how do I connect that to the camera
- how do I address the shaders (or renderers or something) from the schematic
Or of course a tutorial as I think I won't be the only one with the problem. Although I am a kind of newbie with ORK.
I hope you can find time for it. Because I can understand it when you're busy.
Or is it necessary to do it from code anyway?
Thanks, Johan
If you want to do it via schematics, you'd use a Tick Machine on the camera of the scene or a global machine (Game > Global Machines) that executes automatically (e.g. every frame).
The schematic of the machine does:
- raycast to get the object between camera and player
- make it transparent (e.g. via Change Color node)
- get it back to original state if it's no longer hit by the raycast (i.e. remember those objects that where hit via selected data)
Naturally, as you already know - the shader of the objects need to support transparency.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
I was doubting which Machine I should take and was already messing around with the Auto Machine. In vain. But indeed, as you said, the Tick Machine was the solution.
The Raycast works fine, and when I use an Object Visible node it works as intended. But as I said, I want transparency and not a total disappearance.
Indeed I ended up at the Change Color node myself. But it doesn't seem to work at all. Not with a regular shader and not with a transparent shader. And even not if you just want to change the color (so no transparency but a color change).
And also not if I just use the node without raycast and such.
I have tried all 3 modes with Color Type (Renderer, Field and Light) but none of them change color. In combination with both Fade Alpha as well as Red, Green or Blue.
Or am I doing it all wrong and don't understand it right, or is it some kind of bug that prevents the color change from working on the URP pipeline? Can URP be a problem in this case?
This method shows you how to make a character show up behind walls, but you can probably extrapolate it to have an override material that is transparent instead of a single color and opaque
Thank you.