Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | MrHells |
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?
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
Inces | 2022-10-06 16:01
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
MrHells | 2022-10-06 19:06
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
MrHells | 2022-10-09 00:19
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.
Inces | 2022-10-09 07:47
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
MrHells | 2022-10-09 13:15
But what do You use to change color of one Sprite, when it enters Camera view ?. Is it shader ? Is it new image ?
Inces | 2022-10-09 14:57