Norodix / GodotMirror

A versatile mirror for the godot game engine
MIT License
93 stars 12 forks source link

Doesn't work on Godot V4.2 #12

Open JordanStoute opened 8 months ago

JordanStoute commented 8 months ago

Description If I try to enable the plugin, it says "Unable to load addon script from path: 'res://addons/Mirror/plugin.gd'. This might be due to a code error in that script. Disabling the addon at 'res://addons/Mirror/plugin.cfg' to prevent further errors.

Screenshots mirror plugin wont work

Godot version v4.2.stable.official [46dc27791]

Platform Windows 10

Norodix commented 8 months ago

I have not tried it in 4.2 yet. I will make some time and track down the issue soon. Thanks for reporting!

chrisl8 commented 8 months ago

Anecdotally it is working fine for me in 4.2, but I had an existing 4.1 project that I updated. I haven't tried pulling it into a fresh 4.2 project yet.

IsukyPohlo commented 7 months ago

Tried porting into Godot 4 But neither 4.1.3 nor 4.2 worked with the automatic conversion. Tried adding a Material with the shader for the MeshInstance3D inside MirrorContainer scene and it shows a clear blue colored texture in editor but in-game it just renders pink without that change it just spits: res://addons/Mirror/Mirror/Mirror.gd:49 - Attempt to call function 'set_shader_parameter' in base 'null instance' on a null instance.

Editor: image

In-game: image

If you add a mesh to the MirrorContianer.tscn it kinda works: image

Norodix commented 7 months ago

@IsukyPohlo Are you trying auto conversion on the main branch? I think you should try the godot4 branch. As far as I can remember that works on some 4.1 godot version. I will take a closer look later

IsukyPohlo commented 7 months ago

@Norodix Sorry I mixed up my projects and thought godot4 was not working. The branch is currently working with Godot 4.2 stable 👍

Norodix commented 7 months ago

@JordanStoute, Sorry for the late reply. I looked into it and it seems to work for me just as well in 4.2 as in 4.1. Please make sure you are using the godot4 branch. If it still doesn't work, can you send me a minimal reproducible example?

eimfach commented 5 months ago

@Norodix I happend to have the same error like op, only when I restarted Godot 4.2.1, after installing the plugin. It had to do with wrong pathing (the path used on preload in plugin.gd. Somehow the "Mirror" folder is redundant. Also the Mirror.gd had wrong pathing. I fixed it for me, I guess. But it also doesn't work for me, the mirror just stays black.

eimfach commented 5 months ago

Screenshot 2024-04-03 184338 After I changed the size properties of the Mirror Node, I got these fragments on the Mirror

eimfach commented 5 months ago

oh okay now it is working the mirrors mesh was not in my camera cull layers

eimfach commented 5 months ago

If I use it as a child of type "Mirror" it will create two scenes in the remote tree also and one is overlaying the other so the mirror is not visible. It only works if I attach the "Mirror.gd" file to a Node3D directly

Norodix commented 5 months ago

I don't think I follow you. Can you provide an example or some screenshots?

eimfach commented 5 months ago

Hm so basically it only works when I attach the Mirror.gd to a Node3D like in the Demo..

Norodix commented 5 months ago

You are not supposed to attach mirror.gd to anything. You should add new mirror nodes. They are a class, so they appear in the "Create new node" menu.

eimfach commented 5 months ago

Yeah that is not working. So I worked around it and made it like in the demo... works now very well (It was also jumping twice into _enter_tree and I fixed that, it caused flickering)