Problem with shooting after scene change:

Ok so after i click play in the game and the new scene loads and i go to shoot my gun it doesnt shoot…
But when i load the scene by itself the bullets shoot.
here is a link to the project:
https://playcanvas.com/editor/project/605732
if anyone can help ill be happy

1 Like

Nevermind, here it is.

This is a real headscratcher. You’re definitely better at scripting than I am.

Here’s the relevant script: the error points to line 73

Can you explain why you keep referring to “camera.camera” in your script? Isn’t that a bit redundant? I don’t know if that has anything to do with your problem, but it might be worth a look, since that’s what’s been marked as undefined.

EDIT: Looks like you’ve got the same problem when trying to zoom in, too. And it also refers to the camera.camera thing.
image

Oh, is the reasoning behind the camera.camera thing because the camera is a component of the camera entity?
image

1 Like

ahh thts what I am trying to figure out btw I am one of the devs of the game

1 Like

Yes thats what it should be but for some reason it is like that i am not sure why its calling an error when it shouldnt be

this.camera.camera.fov;

this is pulling in the camera entity but then uses the component at the same time :slight_smile:but i may not be doing it correctly i will take a deeper look at it