Can't set resource.texture() to a model

I’m not sure if this is a bug or I’m doing something wrong. According to docs, we can set texture to a model.

Simply what I did:

go.property("enemy_texture", resource.texture("/assests/pink.png"))

function init(self)
	go.set('/go#model', "tex0", self.enemy_texture)
end

returns:

'/go#model' does not have any property called 'tex0'

Model has build-in model.material

Screenshot 2024-08-25 at 13.36.26

Is this how suppose to work? Do you see anything wrong here?

We currently have no way of overriding the textures of a material for a model.
(We want a good way of overriding that on a per model instance basis)

The model does have the old texture0-texture7 properties of a model, but they’re not exactly the same. They allow you to override the texture at that index for all materials assigned to that model.

4 Likes

Got it.

This works for me. Thank you.

3 Likes

selimanac in code you are use pink.png, but in properties value set as blue.png.

Nope, that wasn’t the problem. You can read the @Mathias_Westerdahl answer above.

1 Like