There are a lot of entities and other stuff so creating a new scene would make it easier to fix as well as probably quicker.
Honestly its not that big of a problem, I could just fix it later.
Are you sure? We could fix it right now if you want to as I’m also not busy right now. No pressure though.
Sure, I guess, but I would rather use just one camera.
Using one camera would be better but I don’t know how to do it that way yet. If I found out, I’ll message you as that is also what I’m trying to find out later.
By the way, I’ll be back with you in actually 1 minute.
I’m back! Have you finished creating the new scene yet or still creating it?
I’m very sorry as I have to stop now. I’ll be back with you tomorrow.
Make sure you add the new layer to the camera component and the light component. Otherwise the layer will not be rendered.
I have to add it to the light component also?
It still goes through objects as if it was still on the world layer.
If you want one camera (which I also prefer too), you can use the method shown here where I use a render layer to clear the depth buffer before rendering the weapon later
That script just gives me an error
This script looks like nothing ive ever worked on, idk how it works.
It’s not meant to be parsed, there’s no script type in it for it to be parsed. It’s just some code that gets executed when the script is loaded (ie added to the webpage) by the engine
A script that only works when not parsed? Absolute witchcraft.
I just get this error
Alright so I managed to add the layer in, but it does not seem to work, the gun still phases through objects.
Have you added the layer in the layer order in project settings (see images from [SOLVED] Gun Clip Tutorial not working for me - #3 by yaustar)
Also, look at the render layers used by the weapon where that render layer is in the layer orders
These are my layers
These are the weapon layers
Idk what I am doing wrong
This is a bit tricky, so a few things.
Looking at the RPG weapon that’s on by default, it’s still on the World layer, not the Weapon Layer so all it’s render components need to be changed
The camera needs the Clear Depth layer to be added so that layer is actually used and processed
The last bit is a bit trickier. You will need to create a World UI layer that has the following settings (Transparent Sort needs to be manual)
And add it here between World Transparent and Clear Depth
Then change the render layer for all UI in world space to use the World UI layer (the weapon info text) and finally add the World UI layer to the camera layers.
This because the UI layer renders after the Clear Depth layer which will mean all the world text elements will render over anything that was rendered before it (ie the walls)
So we need to render them before we clear the depth buffer without moving the UI render layer in the layer list because the engine treats that layer specially that ideally, it should be last
And what you get should be something like this https://playcanvas.com/project/1276870/overview/lethal-weapons-f
Side note: It’s more that it doesn’t need to be parsed. It’s code in the global scope so it’s just executed once the script file is added to the webpage on load
I had to do some layer shifting with all the elements in the scene but it seems to work now.