Forum rules - please read before posting.

Highlight script - calling a custom event

I've only just started a new discussion yesterday however thought it best to start a new one for this separate issue rather than bolt this question on the existing discussion just so there is more clarity as to what is being asked and keep discussions on topic.

I'm using a toon shader in my project (currently have been going back and forth between the Unity toon shader and another one I downloaded from the store). The highlight script doesn't seem to work on these shaders (in my limited understanding I can only summise that the highlight script changes certain properties that aren't actually present in these toon shaders).

I therefore looked into calling a custom event where I would instead change the colour of the outline around the object (from black to white) and make the line slightly bigger to mimic a highighting effect. The problem is that when I select 'call custom event' in the inspector on the highlight script and try to click on the '+' sign to add a new event to call nothing gets added and the box stays empty.

I'm using the latest Unity and AC (1.50i) and can't see what I'm doing wrong, however more than likely I am haha! So I guess I'm looking for 1 of 2 solutions; either advice on how to call a custom event (as I may be doing it incorrectly) or advice on a way that someone else has managed to highlight an object that uses a toon shader?

Thanks in advance.

Comments

  • I use Object -> send message

    I can then pass a string of the methods name to run. Have you tried this ?
  • @klarax
    Thanks for the reply. I'm fairly happy though with what the message/event will be (I say fairly happy because I am still very much a beginner when it comes to programming/coding/unity etc) however the problem seems to be that the 'call custom event' in the inspector of the highlight script doesn't seem to allow me to add anything at all in the 'OnHighlight' box so I can't get to the point where I can specify an action of Object: Send Message.

    I've read this back a few times and I fear I've not explained it well enough however I will take some pics when I get back tonight which should hopefully help.
  • @klarax (and others if interested lol)
    Here is an image of the inspector, not sure how to add anything in the boxes highlighted in red, when I click the plus sign in the blue box nothing happens. I'm surely doing something wrong I imagine.

    http://postimg.org/image/xbvkythsn/
  • Sorry mjbcfc,

    I cant help any further, as A) i do it differently, and B) i dont have this feature as im using another (older) version. 

    Im sure Chris can tell you whats what tho :)
  • Events not showing up in the Inspector sounds like a bug - could be to Unity 5.3-related.  I'll have a look.

    You're correct about the vanilla Highlight script requiring a certain shader property - specifically it looks for the "_Color" property in the shader code.

    There is an alternative solution, however.  The Highlight script has the public function GetHighlightIntensity (), which you can read in a custom script to set whatever shader property / effect you want.
  • Cheers Chris. Now you mention colour I have managed to get a work around, the custom toon shader I have has a tickbox for 'Enable Colour Tint' which was unchecked, I have therefore checked this the standard highlight script seems to affect the shader as designed.

    Thanks for the help Chris.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.