Ok, so I have my world space canvas attached to the player object. In my script I have a reference like this :
GameObject myWorldCanvas;
Awake()
{
myWorldCanvas= transform.FindChild("nameOfObject").gameObject;
}
Then when the right conditions are met I simply activate the object like this :
myWorldCanvas.SeActive(true);
This worked perfectly until I added a animator to the object. If I manually enable/disable the object in the scene the animation works perfectly(it just changes the scale to give it a pop effect), but when the object is activated by my script the animation still plays and changes the scale values but nothing is rendered. In play mode if I manually enable/disable the animation works.
Any ideas ? If you need more info or screens let me know.
Edit : the canvas has some buttons as children and when I mouse over something seems to be refreshed and the images show up on screen.
Edit: Further test have show that manually disabling and enabling the Canvas component also shows the images, but If the canvas and game object are enabled from a script nothing shows up on the screen.
Edit: I solved the problem by disabling the canvas component on the first key of the animation and then enabling it on the second one where the Y scale is set to 0. This seems more like a hack and I dont like it. Does anyone have a idea why this is happening ?