ramokz / phantom-camera

👻🎥 Control the movement and dynamically tween 2D & 3D cameras. Built for Godot 4. Inspired by Cinemachine.
https://phantom-camera.dev/
MIT License
1.97k stars 65 forks source link

Error when launching a scene with a PhantomCamera from a build export #181

Closed vgwyn closed 2 months ago

vgwyn commented 6 months ago

Issue description

When I'm launching my game on Android, and go into a scene that has PhantomCamera nodes, I get an error output.

The issue is caused from line 27 in the viewfinder.gd script: Parser Error: Could not find type "EditorInterface" in the current scope.

Steps to reproduce

  1. Create a 3D project with a camera and PhantomCamera nodes
  2. Set up Android phone & export
  3. Connect Android via USB and run it there through the Remote Debug button in Godot
  4. Issue should appear. Keep the phone connected to the host editor to see the Debugger show the error

(Optional) Minimal reproduction project

No response

ramokz commented 6 months ago

Also referenced in #164.

Do you experience a crash, or is it just the error log?

vgwyn commented 6 months ago

It does halt the game, but it's just an error in the log -- I can resume the execution of the game through the pause/play running project button.

It resumes naturally when I am not using the debugger / if I have my Android unplugged.

ramokz commented 6 months ago

Nice, then it does seem to be a general export issue, rather than Android specific. As I also saw this the other day when doing a Linux and Mac build.

Not a high priority, but needs to be addressed still.

friit commented 6 months ago

Getting this issue too, it resolves itself after about 30 seconds, but halts level loading till it clears.

Edit: Having this plugin installed also seems to break android apps when closed and reopened. Removing nodes doesn't fix, only removing nodes and plugin fixes the issue

ramokz commented 6 months ago

Exported a build and tried running the 2DLimitExampleScene.tscn on an Android. Didn't see anything unusual, so doesn't seem to only affect a build directly, only when running it in debug mode when connected to the computer.

Getting this issue too, it resolves itself after about 30 seconds, but halts level loading till it clears.

Is this when you're running a debug build using the steps @vgwyn lists above, or when running the project without the Godot debugger — i.e. on the phone independently?

Having this plugin installed also seems to break android apps when closed and reopened. Removing nodes doesn't fix, only removing nodes and plugin fixes the issue

Not entirely sure what that is about. When you say “break android apps when closed and reopened”, do you mean it crashes other opened apps?

friit commented 6 months ago

Exported a build and tried running the 2DLimitExampleScene.tscn on an Android. Didn't see anything unusual, so doesn't seem to only affect a build directly, only when running it in debug mode when connected to the computer.

Getting this issue too, it resolves itself after about 30 seconds, but halts level loading till it clears.

Is this when you're running a debug build using the steps @vgwyn lists above, or when running the project without the Godot debugger — i.e. on the phone independently?

After a little more testing the slow down was not related to Phantom Camera but something else, when not running with remote debug the error isn't a problem.

Having this plugin installed also seems to break android apps when closed and reopened. Removing nodes doesn't fix, only removing nodes and plugin fixes the issue

Not entirely sure what that is about. When you say “break android apps when closed and reopened”, do you mean it crashes other opened apps?

Deploying via remote debug works fine until the app is closed. It then fails to reopen. The application can be paused and it will resume but if it closes it will not be able to reopen. The only way to get the app to run again is to redeploy. Clearing app cache or force stopping it does not fix the issue. I tried removing various things but only removing the whole PhantomCamera plugin fixed the issue. I don't have any detailed logging from the app unfortunately, I will attempt to replicate this in a sample project when I have the chace.

ramokz commented 6 months ago

Deploying via remote debug works fine until the app is closed. It then fails to reopen. The application can be paused and it will resume but if it closes it will not be able to reopen. The only way to get the app to run again is to redeploy. Clearing app cache or force stopping it does not fix the issue. I tried removing various things but only removing the whole PhantomCamera plugin fixed the issue. I don't have any detailed logging from the app unfortunately, I will attempt to replicate this in a sample project when I have the chace.

That sounds super weird! I'll have a tinker with the removing the error that's been mentioned a few times soon. That might solve the issue altogether. If it doesn't then we can see if there's a way to debug it further.

SaadTheGlad commented 5 months ago

I am getting this issue as well but it's breaking the limiter functionality. I'm referencing a tilemap to limit the camera and it works in the editor but after exporting it breaks and gives me this exact same error in the debugger. image

ramokz commented 5 months ago

I am getting this issue as well but it's breaking the limiter functionality. I'm referencing a tilemap to limit the camera and it works in the editor but after exporting it breaks and gives me this exact same error in the debugger.

Limit export issue is also reported in #164. The error you see isn't related to the viewfinder.gd error though, but rather a problem with the property itself. Still have no idea what's causing it, but it appears to be solved in the 0.7 branch in all my export tests so far.

SaadTheGlad commented 5 months ago

I am getting this issue as well but it's breaking the limiter functionality. I'm referencing a tilemap to limit the camera and it works in the editor but after exporting it breaks and gives me this exact same error in the debugger.

Limit export issue is also reported in #164. The error you see isn't related to the viewfinder.gd error though, but rather a problem with the property itself. Still have no idea what's causing it, but it appears to be solved in the 0.7 branch in all my export tests so far.

Thank you, when is that branch going to be finished btw?

ramokz commented 5 months ago

Thank you, when is that branch going to be finished btw?

Sometime shortly after Godot 4.3 releases — it's just to ensure that it's compatible out of the gate.

friit commented 5 months ago

Deploying via remote debug works fine until the app is closed. It then fails to reopen. The application can be paused and it will resume but if it closes it will not be able to reopen. The only way to get the app to run again is to redeploy. Clearing app cache or force stopping it does not fix the issue. I tried removing various things but only removing the whole PhantomCamera plugin fixed the issue. I don't have any detailed logging from the app unfortunately, I will attempt to replicate this in a sample project when I have the chace.

That sounds super weird! I'll have a tinker with the removing the error that's been mentioned a few times soon. That might solve the issue altogether. If it doesn't then we can see if there's a way to debug it further.

So I got the chance to hunt this down at last, it was actually related to remote deploy, when deployed via android studio everything works fine.

ramokz commented 2 months ago

This should be resolved in the latest release, but feel free to reopen if not.