Forum rules - please read before posting.

Hightlightscript

Hi,

First I wanted to say that your Asset is awesome! I'm using it now almost for a year. Most of the time I was just playing a bit around, getting comfortable with the system and other assets - trying sth etc. Stopped for a while, began again... stopped etc. Now, I'm in a bigger project and I'm having a simple Question.

Is there a way to let objects highlight with the highlight script? Or can Interactable objects always pulse?

My problem is that I'm using Invectors 3rd Person Controller and AC. The Hotspot Detection script / mode works fine for me (with Player Vicnity), instead of that the character is also able to pick up everything whats inside the collider of the hotspotsdetector gameobject (attached to the Controller, like in the tutorial). It detects and let me interact with it objects, even if I cant see the objects or if there on another level in the building. 

I also have to mention that my scripting skills are not good enough, so I'll hope there is a solution for it without writing a custom script. It's really awesome what options and things you can choose and create from without writing any lines of code! 

Greetings and thanks in advance!









Comments

  • edited November 2018
    Welcome to the community, @eMPi1984.

    I'm a little unsure as to how your question relates to your problem.  Object highlighting is a purely visual effect - though an interactive object can be made to highlight, an object highlighting doesn't make it interactive.

    You can make a Highlight component brighten by running its HighlightOn function through script, or by using the Object: Highlight Action.

    I'm not totally clear on your exact problem - could you explain in more detail and provide screenshots?  We'll need to be sure not just about what's happening, but which parts are what you want, and which parts are not.  Detail such as how exactly you interact with Hotspots (e.g. click, button press) will also be necessary.

    If custom scripting is required, assistance can be given - but please understand that attempting to link two complex assets together in the way that you are will inevitably require it.
  • Thanks for the quick reply.

    Im trying to be bit clearer though.

    My Game:

    You're playing in 3rd Person perspective. You can walk around, pick up items with hotkeys and you can fight. You interact with objects via hotkeys ('E' for Use f.e.) and youre not able to click with the mouse on objects.

    My goal:
    I want to highlight interactable objects automatically, so that the Player can see immediately which Objects are interactable and which aren't. Since my game plays in a post apocalyptic environment, its crucial for me to sort useable and not usable objects out due to the massive amount of garbage lying around. Without Icons, just the Object flashing / pulsing.

    A good example of this would be the game "The Last of Us". As soon as objects are interactable - they are flashing and you can pick them if youre really close to them. They flash even from far distances so that the player gets a hint of useable and not useable objects (and this is exactly what I want - far distance flashing).

    My problem:
    It's already working with the hotspot detector mode, but the problem: the Player can also interact with everything inside the Hotspotdetector component which is attached to the player, because its a trigger (I guess) and because I'm using invectors 3rd Person Controller (I think it recognizes the trigger as an 'useable area'). The Spherecollider of the HotspotGameobject is set to really huge.

    So, when I'm far away of objects that are flashing (or even not, because its inside a house with different levels), he can immediately interact with those objects even if he stands miles away from them instead of standing in front of them. Easy said: the player could interact with those objects all immediatley.



    My Scenesettings:

    image
    image

    HotspotSettings:

    (Sidenote: UseInteraction is just used for self destroying of the Hotspot, so that it dissapears. I just used the Hotspot for the 'Flashing Object' properties.)

    image
    image

    And yes, I know that there will be a point coming up where I have to use / write scripts for certain things. For now, everything is working without scripts and I'm getting really creative to find some workarounds to avoid that. Although, I almost got everything working - instead of the flashing object thing. 







  • Oh im Sorry. I thought it would show the images inside the post.

    The Links again:

    SceneSettings:

    https://imgur.com/a/a3hoXys
    https://imgur.com/a/FV4Un8I

    HotspotSettings:

    https://imgur.com/a/In0KsyA
    https://imgur.com/a/g40Ymog




  • I don't see any large SphereCollider on your Hotspot.  Were you actually referring to the Hotspot Detector's collider?

    Typically, Hotspot highlighting is synced with interactivity: if a Hotspot is highlighting or it's icon is showing, it can be interacted with at that moment.  What it sounds like you're wanting is for Hotspots to highlight independently of that.

    First of all, I would bring your collider sizes down so that the game behaves (purely on the interactivity level) the way you intend.  Without worrying about Highlighting for the moment, does simply reducing the collider's radius to "arms reach" give the correct behaviour so far as the player interacting with Hotspots goes?

    If so, you'll then want to prevent Highlight components from brightening under the normal criteria.  Do this by unchecking Enable when associated Hotspot is selected?.  Next, we'll use a custom script to have them pulse when they're within a separate Sphere Collider on the Player.

    Make a new Sphere Collider (as a Trigger) on the Player that's got the same as your original, larger, radius.  Attach this script as a component named BrightenHotspots.cs:


    The code is simple: when a Collider enters the Sphere collider and has a Hotspots component on it, it's associated Highlight component is made to pulse.  When it exits, the effect is turned off.  There's no need to attach a separate Collider to your Highlight, and your Highlight's events should not link onto itself - unset the "Pulse" function from your Highlight's "On Highlight On" event.
  • Yeah nice. It's working. 

    This script is even for a beginner as I am, easy to read & understand. Thanks for your help.

    btw.: Sorry for the late reply, I was on vacation ;-)
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.