[SOLVED] My jump script isn't working if there is gun clipping

After adding a jump script to my FPS game which has gun clipping, it doesn’t work. Whereas, if I add the jump script to my FPS game without the gun clipping part, it works.

Project Link: https://playcanvas.com/project/1276228/overview/gun-clipping

Please Help.

1 Like

define “gun clipping”

adding the gun to a different layer so that it doesn’t go through walls or other objects in your game.

i solved it. Gun Clipping and Movement Sol. Link

I have been trying to figure out how to do that myself

You really dont need all these useless entities. Move every entity that has a render into one parent entity and delete every entity that has nothing.

1 Like

Here’s how to do it:

1. Go into the project settings, click on “Layers” and add a layer called “Weapon”

2. In the shotgun template, remove the “World” layer and add the “Weapon” layer to every render.

3. Go into the project settings again, click on “Layers” and change the “Render Order” to this:

image

For me that just makes the gun invisible

Is the hierachy the same? My hierachy is this:
image

weapon camera? Do I need 2 cameras? Sounds quite taxing

1 Like

The original Camera’s priority is 0 and the WeaponCamera’s priority is 1.

I can now see the gun, but the gun is entirely black.

Could you please send me the project link so I can compare both projects?

I can change the color with emission, so it must be lighting related.

ALUCARDS LETHAL MUNITIONS EXPO | Editor

What entity is the gun called and which entity is it located in?

1 Like

Yeah, I think this is a lighting problem . Adding a light should help or adding a skybox could also work but you have walls around you.

The light is attached to the camera, it should be working.

1 Like

In that case, if you wouldn’t mind, could you please create another scene and place player entity without all the other models that are not needed as of now. It’s because its all cluttered and messy right now.

what is “cluttered and messy”?