Hide object on mouse hover

  • #1, by Toasted AdventuresWednesday, 23. September 2015, 14:48 5 years ago
    Hi!

    I want to make a room with a wall. And I want the wall to disappear when I hover over it with the mouse so that the player can see something hidden on the other side. Is this possible?

    Thank you!

    Lo

    Newbie

    6 Posts


  • #2, by afrlmeWednesday, 23. September 2015, 16:51 5 years ago
    Instantly disappear or fade out? & is the player required to interact with the thing on the other side of the wall?

    Imperator

    6800 Posts

  • #3, by Toasted AdventuresWednesday, 23. September 2015, 17:18 5 years ago
    Hmm, I guess either would be fine. But instantly disappear is somewhat preferable. And also preferably there would be something behind the wall that the player could interact with, but it's not super important.

    It's more because with the view I'm using sometimes the walls are covering the floor, i.e the path where the player can walk. And I want to keep the walls because it looks better but if the player could hide the walls and reveal the floor behind them it would be very nice.

    But it would also be nice if there was an object hidden behind the wall that the player could interact with.



    EDIT:
    Here's a very rough draft of what I'm talking about. https://gyazo.com/4facb2c1d2bd0c310943a133a045ea47

    The walls are covering the floor. And in the bathroom for example you can see the toilet in the mirror but otherwise the wall is covering it.

    Newbie

    6 Posts

  • #4, by tristan-kangWednesday, 23. September 2015, 18:23 5 years ago
    First of all, make the wall as image. I mean, you need to make the background image as without wall.

    Then, put the wall as a object then it looks like original image you made.

    Now, in the background image, you don't have the wall.

    Second of all, with the editor, after you made the object, make another object. I'll call this mimic object.

    Create object area on the mimic object (Just as much as the wall you're going to cover).

    Now create the condition for the object (not mimic one, I mean the wall) and set condition's initial value as true.

    Finally, add the actions to mimic object. It should be cursor enters object area and cursor leaves object area.

    When cursor enters object area, add the action set condition wall object's condition false. Do this thing contrariwise when cursor leaves the area.

    It should be work.

    Great Poster

    267 Posts

  • #5, by afrlmeWednesday, 23. September 2015, 18:28 5 years ago
    Ah I see, you are going for the Sims / RPG style thing. I think semi-transparent would probably look the best? You could of course create another image to display in its place on mouse over instead, or if you prefer or you could hide it entirely.

    Ok so if you are wanting to be able to interact with things hidden behind a wall then you are going to need a condition to determine when to enable said objects. On mouse over the wall go to scene actions > set object visibility. This will allow you to specify the opacity level (transparency) of an object as well as set the amount of time it should take to transition to the new opacity value. A value of 0 would be instant, whereas a value of 1000 would be 1000ms which is 1 second.

    Next you would create an action for setting the condition we talked about earlier to true. This would enable the objects / action area behind the wall so that the mouse cursor can detect it.

    For setting it back you would use a on mouse out action & just do the same actions again, but would set the condition to false & the opacity back to 100%.

    An alternative method you could use would be to create action areas in the way system of the scene, so that when your character walked into a specified area you could set the opacity of the wall to make it invisible or semi-transparent & enable the object areas for interaction & do opposite for when character leaves the action area. Personally I think this method would be much cleaner.

    Sorry for the epic amount of text. Hope this provides you with a few ideas. wink

    Imperator

    6800 Posts

  • #6, by tristan-kangWednesday, 23. September 2015, 18:30 5 years ago
    lol AFRLme you answered it just right after me.

    Great Poster

    267 Posts

  • #7, by afrlmeWednesday, 23. September 2015, 18:33 5 years ago
    I started typing a while back. Took me a while to type up that wall of text...Two finger typing! grin

    P.S: was also trying not to type out a step by step guide. I think it's more beneficial for me to provide hints as opposed to complete solutions like I used to do, otherwise people aren't going to figure stuff out for themselves.

    Imperator

    6800 Posts

  • #8, by tristan-kangWednesday, 23. September 2015, 18:42 5 years ago
    LoL you type it with two fingers? WoW

    Well I didn't question frequently when I handle this engine. This game engine's interface is pretty intuitive.

    Perhaps I handled another game engine before, so that's why I can figure out many things without questions.

    P.S: Yeah I agree with you. But the hint can be work but it may result another question. Well I'm not a good teacher... roll

    Great Poster

    267 Posts

  • #9, by afrlmeWednesday, 23. September 2015, 19:06 5 years ago
    I used to type with both hands & all fingers. My fingers tend to hurt these days after a short while so I tend to end up typing one or two fingers on my left hand & two to three fingers with my right hand. The biggest issue with not typing how you are supposed to type is that you generate more typos - which you end up having to backspace & undo. Oh well.

    I've spent the better part of the past 2 years (+++) or so (often) providing in-depth solutions to peoples questions or even going as far as spending hours mocking up templates & examples for people, but I don't get paid for it & I'm a lot busier than I was. Plus if I keep on providing all my scripts, methods & techniques to everyone for free, then no one will require me for any freelance work & everyone will be using my own methods instead of learning their own.

    The thing with VS is that there is not really a right or wrong way to use it & there's often multiple methods that can be employed to achieve the same thing.

    Imperator

    6800 Posts

  • #10, by Toasted AdventuresWednesday, 23. September 2015, 20:24 5 years ago
    Thank you so much!! grin This forum is so helpful, I love it! smile

    Newbie

    6 Posts

Write post