• edited December 2018
    yes of course I tried that. again it does'nt call the lightsOFF when I get out of the interaction range, and also when it's only 1 item it disappears the item weirdly...

    my script (with the correct functions-spelling of lightOff and lightOn):

    using UnityEngine;
    using ORKFramework.Behaviours;

    public class CustomInteractionController : InteractionController


    {

    public override void SortInteractions()
    {
    if (this.list.Count > 0)
    {
    shaderGlow comp = this.list[0].GetComponent();
    if (comp != null)
    {
    comp.lightOff();

    }
    }

    base.SortInteractions();

    if (this.list.Count > 0)
    {
    shaderGlow comp = this.list[0].GetComponent();
    if (comp != null)
    {
    comp.lightOn();

    }
    }
    }
    }


    also having these 2 warnings (not errors):

    The referenced script on this Behaviour (Game Object '') is missing!
    UnityEngine.Object:Instantiate(GameObject, Vector3, Quaternion)
    ORKFramework.UnityWrapper:InstantiateGameObject(GameObject, Vector3, Quaternion)
    ORKFramework.UnityWrapper:Instantiate(GameObject, Vector3, Quaternion)
    ORKFramework.Combatants.CombatantObject:Spawn(Vector3, Boolean, Single, Boolean, Vector3)
    ORKFramework.PlayerHandler:SpawnPlayer(Vector3, Boolean, Single, Boolean, Vector3)
    ORKFramework.PlayerHandler:SpawnPlayer(Int32)
    ORKFramework.Events.Steps.SpawnPlayerStep:Execute(BaseEvent)
    ORKFramework.Events.GameEvent:ExecuteNextStep()
    ORKFramework.Events.BaseEvent:StepFinished(Int32)
    ORKFramework.Events.Steps.JoinActiveGroupStep:Execute(BaseEvent)
    ORKFramework.Events.GameEvent:ExecuteNextStep()
    ORKFramework.Events.BaseEvent:StartEvent()
    ORKFramework.Events.GameEvent:StartEvent(IEventStarter, Object)
    ORKFramework.Behaviours.d__29:MoveNext()
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    ORKFramework.Behaviours.EventInteraction:StartEvent(GameObject)
    ORKFramework.Behaviours.BaseInteraction:DoAutoStart()
    ORKFramework.Behaviours.EventInteraction:CheckAutoStart()
    ORKFramework.Behaviours.EventInteraction:Start()


    The referenced script on this Behaviour (Game Object 'FPSCustomController_Uni_PPS') is missing!
    UnityEngine.Object:Instantiate(GameObject, Vector3, Quaternion)
    ORKFramework.UnityWrapper:InstantiateGameObject(GameObject, Vector3, Quaternion)
    ORKFramework.UnityWrapper:Instantiate(GameObject, Vector3, Quaternion)
    ORKFramework.Combatants.CombatantObject:Spawn(Vector3, Boolean, Single, Boolean, Vector3)
    ORKFramework.PlayerHandler:SpawnPlayer(Vector3, Boolean, Single, Boolean, Vector3)
    ORKFramework.PlayerHandler:SpawnPlayer(Int32)
    ORKFramework.Events.Steps.SpawnPlayerStep:Execute(BaseEvent)
    ORKFramework.Events.GameEvent:ExecuteNextStep()
    ORKFramework.Events.BaseEvent:StepFinished(Int32)
    ORKFramework.Events.Steps.JoinActiveGroupStep:Execute(BaseEvent)
    ORKFramework.Events.GameEvent:ExecuteNextStep()
    ORKFramework.Events.BaseEvent:StartEvent()
    ORKFramework.Events.GameEvent:StartEvent(IEventStarter, Object)
    ORKFramework.Behaviours.d__29:MoveNext()
    UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
    ORKFramework.Behaviours.EventInteraction:StartEvent(GameObject)
    ORKFramework.Behaviours.BaseInteraction:DoAutoStart()
    ORKFramework.Behaviours.EventInteraction:CheckAutoStart()
    ORKFramework.Behaviours.EventInteraction:Start()
    Post edited by dlevel on
  • If the name of the component is shaderGlow, you need to use this line to get the component:
    shaderGlow comp = this.list[0].GetComponent<shaderGlow>();
    But make sure the name of the component is correct.

    The warnings let you know that some of the components on game objects you're spawning are missing their script references. I.e. the scripts of those components have either been removed or renamed and Untiy can't find them any more. To fix this, you either need to select the correct script for them or remove the components.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited December 2018
    don't know why it didnt pasted the correct way, this is how I have it.

    public class CustomInteractionController : InteractionController

    {

    public override void SortInteractions()
    {
    if (this.list.Count > 0)
    {
    shaderGlow comp = this.list[0].GetComponent();
    if (comp != null)
    {
    comp.lightOff();

    }
    }

    base.SortInteractions();

    if (this.list.Count > 0)
    {
    shaderGlow comp = this.list[0].GetComponent();
    if (comp != null)
    {
    comp.lightOn();

    }
    }
    }
    }


    lol again it doesn't include the shaderGlow inside the brackets (it dissapears when I post the comment here, maybe its an html or sth), anyway I have it exactly as you have it. And yes it is correct, it just has the behavior I describe in my previous post
    Post edited by dlevel on
  • Alright, if you don't get any errors for the interaction controller, I'd assume it didn't find the component, try this line instead:
    shaderGlow comp = this.list[0].GetComponentInChildren<shaderGlow>();
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited December 2018
    exact same behavior. It does find the component because it calls it, but when getting out of the interaction range it doesn't disable it, and when it's only 1 object the 3d object also disappears. Maybe is something to do with triggerEnter and triggerExit? or maybe because both try to call when its > 0 ?
    Post edited by dlevel on
  • Ah, yeah, that case you need to override the trigger exit function:

    protected override void OnTriggerExit(Collider other)
    {
    base.OnTriggerExit(other);
    CustomComponent comp = other.gameObject.GetComponentInChildren<CustomComponent>();
    if(comp != null)
    {
    comp.lightsON();
    }
    }
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited December 2018
    So the first part works fine for 1 object (TriggerEnter and TriggerExit), but when I have many objects it lights on all of them so I m trying to do the SortInteraction think without success again, having the issues I had before. Any idea?



    using System;
    using UnityEngine;
    using ORKFramework.Behaviours;

    public class CustomInteractionController : InteractionController


    {

    protected override void OnTriggerEnter(Collider other)
    {
    base.OnTriggerEnter(other);
    shaderGlow comp = other.gameObject.GetComponentInChildren<shaderGlow>();
    if (comp != null)
    {
    comp.lightOn();
    }
    }

    protected override void OnTriggerExit(Collider other)
    {
    base.OnTriggerExit(other);
    shaderGlow comp = other.gameObject.GetComponentInChildren<shaderGlow>();
    if (comp != null)
    {
    comp.lightOff();
    }
    }

    public override void SortInteractions()
    {
    if (this.list.Count > 0)
    {
    shaderGlow comp = this.list[0].GetComponentInChildren<shaderGlow>();
    if (comp != null)
    {
    comp.lightOff();

    }
    }

    base.SortInteractions();

    if (this.list.Count > 0)
    {
    shaderGlow comp = this.list[0].GetComponentInChildren<shaderGlow>();
    if (comp != null)
    {
    comp.lightOn();

    }
    }
    }


    }

    Post edited by dlevel on
  • Yeah, don't override the OnTriggerEnter function, as that'll light all objects that enter the trigger.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • yes, of course, I tried it without but again it doesn't work. It dissapears the object when I don't use the InTriggerEnter and use the SortInteractions. I gave it every try with every different combination with the above code, the only thing works is when I only use TirggerEnter and TriggerExit on single items, when I use the SortInteraction it doesn't work with the behaviors I explained above :)
  • In that case try this:
    protected override void OnTriggerEnter(Collider other)
    {
    base.OnTriggerEnter(other);
    this.SortInteractions();
    }
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited December 2018
    without overriding the SortInteractions at all?

    soemthing like:



    using System;
    using UnityEngine;
    using ORKFramework.Behaviours;

    public class CustomInteractionController : InteractionController


    {

    protected override void OnTriggerEnter(Collider other)
    {
    base.OnTriggerEnter(other);
    this.SortInteractions();
    }

    protected override void OnTriggerExit(Collider other)
    {
    base.OnTriggerExit(other);
    shaderGlow comp = other.gameObject.GetComponentInChildren<shaderGlow>();
    if (comp != null)
    {
    comp.lightOff();
    }
    }



    sorry for the hustle but I m trying for weeks :S
    Post edited by dlevel on
  • No, with including the override for SortInteractions, since that's what doing the highlighting ...
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited December 2018
    61) yeah again same issues :/ anyway if you find sometimes to look it up please do, at the moment I have it with triggerenter triggerexit only, which doesn't work well when there is more than 1 item

    62) I'm setting up the XBOX controller to work with the game which means that when the player uses the controller (plays in the xbox) the UI will change. What I'm trying to achieve is that when the player hold a button, a new shortcut bar appears, and while holding this button, by pressing another button does the skill in that slot. So pressing RT(right trigger) on controller, switches the right shortcut bar while holding, and then pressing X which holding RT does the first skill in this shortcut.

    Also what If I wanted to have another UI in windows when the player changes to controller would that be possible?
    Post edited by dlevel on
  • 62) Switching UI due to the controller would require either recognizing that automatically and setting a variable in ORK to show different HUDs, or having some option (menu) that sets that variable.
    As for HUDs being shown when pressing a button, check out the HUD's toggle key settings - this can either be used to toggle a HUD on/off or only show/hide it when the input is valid (e.g. Hold input for the right trigger). Using different actions when holding RT can be done through control maps using an input key set up as a combination of holding RT and whatever other key. Use the ORK Input Key origin and add both inputs (holding RT and e.g. X), needing All inputs.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited December 2018
    63) It seems there is a bug in 2.20.0 regarding inventory menu screen and blocking (explain it in bug section).

    64) Is there a way to have a mass sell items of a type in shops?

    65) trying to make the player rotate 360 degrees with a 1" fade so it does a whirlwind skill, I set my rotate to node to rotate by 360 and rotate object to be the user, but it goes up to 45 degrees and stops.
    Post edited by dlevel on
Sign In or Register to comment.