Hi,
As an added effect to my 3D Player Menu (see other thread) I have the characters lighting up when we hover over them, and displating their name.
I would like a "pillar of light" to also appear.
I have a "pillarof light" prefab. So I was hoping to use the Custome Events feature of the highlight script to activate a prefab and deactivate it when user rolls off.
When I tried this, I dragged my Light beam object into the slot, and selected GameObject:Set active. and clicked the tick box.
When the game runs, this deactivates... Im obviously not understanding the correct operation of this feature, but it is, unfortunately under- explained (not at all) in the manual.
Comments
When the game runs, this deactivates...
Sorry I was unclear...
with
PM you can even click within the action and it takes you to that wiki
page (I think its a wiki- easier for them to maintain than a pdf manual
too)
AC has a similar feature - click on the Manual icon at the top of any AC component, and you'll be taken to the relevant page in the scripting guide. The entry for the On Highlight On event can be found here.
The issue is actually due to the inability for Unity to allow for the setting of event parameters in a custom UI. Notice that when the game begins, the checked state of the "On Highlight On" event is disabled.
The workaround is to attach a simple script to the object with separate On/Off functions that do the activation/deactivation through script. @Alverik is quite right, though - Unity can often have trouble referencing deactivated objects, so you'd be better off enabling/disabling components within the GameObject itself.
Dragging the PLANE into the highlight custom event slot, then disabling it, and using GameObject:SetActive.. worked... now Ive made a pretty nice menu thanks to you!