0 votes

The game is a 3D first person game, the items droped on the floor are Sprite 3D nodes, when picking them up, they are displayed on the inventory, which uses the same png file.

When the droped item, with the 3D sprite, enters the camera view, the inventory item, which uses the same image, instantly change in color.

What could it be?

Godot version 3.5
in Engine by (32 points)

Do You manipulate texture in code ?
If yes, You need to mark image resource as local_to_the_scene in both sprites parent scene, it is under the texture/resource property

yes = true, but even setting it in the editor, what I was doing before I had this item code, made the sprite redish too.

I'll try this as soon as I open the project tonight, I had a problem with shaders that I solved this same way.

thank you

I just tried it, but doesn't work... I set it via editor and then through code, but both of them didn't work.
Checking the remote tab, I can see all the sprites with "local to scene" markbox checked, but the 2D ones are redish

It depends on what You actually manipulate with code. Is it texture, or material, or shader params ? Each of these has their own resource tab and local_to_the_scene property
If You are using new()command to create one of these, You also should make_unique after loading them.

It is a scene, I make an intance of the object, then item = drop_item(), and in its set function, I make the sprite3D.texture, and set via resourse_local_to_scene = true

But what do You use to change color of one Sprite, when it enters Camera view ?. Is it shader ? Is it new image ?

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.