Hi all,
Can you help with the following issue?
The Highlight script is not working on 2D objects (sprites) in a 3D game.
Screenshot:
I experience the above issue under the following version under 64bit Windows 10:
- Unity 5.6.0b5 with Adventure Creator v1.55c
Thank you for all of your assistance in advance!
Feel free to let me know if you need any further info, screenshot and or video about the mentioned issue I experience!
Comments
Perhaps it's to do with the way your scene is lit, or some quirk of Unity that I'm not aware of. The Highlight script merely increases the brightness of the material's "_Color" property - the official Unity forums may be a more appropriate place to ask this question.
Are you certain you need to be using a sprite for this object? A quad with this graphic set to it's Material texture would have a similar appearance.
Try using the Standard shader but with an Emission value - that should make it work with the Highlight script but also make it brighter than other materials.
If need be, a custom script can be written to affect your chosen material. The Highlight script, as I said, will brighten a Material's "_Color" property - so if it doesn't exist, the script won't have any effect. The intended brightness, as set by the Highlight script, can be read, however - meaning you can use it however you want - whether it be to change a material's colour, transparency, or whatever.
I agree that it should be working without need for a custom script, but again, this is an issue with the way your scene is lit, or some setting due to Unity - not an AC one. AC is working correctly, which you've seen for yourself in the 2D demo, and it also works on sprites in the 3D Demo.
That this is not 3D does not prevent the Highlight script from working - instead, it is due to some unidentified setting in your scene. It may be a lighting setting, a "static" option on your object, or some rendering / quality setting.
You can try assigning the Demo managers again to see if that changes anything.
I don't understand how you got a Quad working with the Sprites/Default shader, though. There's no sprite slot on a Mesh Renderer, and the sprite shader itself doesn't come with a Texture field. I'd need to see screenshots to see how that's achieved.
Works for me in the 3D Demo game on a quad with the 2D Demo game's "Lunch" sprite. Giving it the Highlight script and changing one of the Hotspots so that it highlights that instead has it brightening up. See if the same thing works for you.
You could also test the opposite, i.e. assigning your own Managers in the 3D Demo, and see if you can still highlight the mesh.
I'm still inclined to believe this is a Unity issue, however. Likely a lighting or graphics setting as I've been saying. You should try comparing your Project / Quality / Graphics settings between the two projects, as well as the Lighting windows between the two scenes. If it works in one project but not the other, it does suggest that there is a project or lighting setting causing this issue.