in my game I have a ray sensor in my player-object searching for the property "block".
If the "block" property is found in a target-object, it changes the color of the target-object from [ 0.0, 1.0, 0.0, 1.0] to [ 0.0, 1.0, 0.0, 0.2] (so it changes the alpha). These target-objects have the same material, let's call it target-material.
If I use a logic brick actuator to replace the mesh of the target-object with the mesh of another object, the following things happen:
a)If the material of the new mesh is a different one or non-existent the color does not change when hit by the ray.
b)If the material of the new mesh is the target-material then everything works as intented.
So my question is, since the property "block" still exists in the object, why does it not change the color of the new mesh's material? I understand that if there is no material in the new mesh then the color won't change cause it needs one. Am I wrong there?
And my 2nd question is this.
Why when I add more target-objects in the scene (I noticed it happens if I add more >2 but it might be random) does the color differ? Check the 2 pictures below.
To be honest the 2nd image feels more right since I only messed with the alpha so it should only make it more transparent and not darker, but still why does this happen? Nothing else was changed. Just another cube like the rest was added.