Search Unity

First Person Interactions - Not sure how to go about it

Discussion in 'Game Design' started by kittik, Jun 4, 2015.

  1. kittik

    kittik

    Joined:
    Mar 6, 2015
    Posts:
    565
    I am currently creating the way in which a player interacts with important objects in the world I am developing.

    Originally I had intended on having a player right click when they entered a trigger collider of an important object. Then this important object would interact with the player. This interaction ranging from pulling a lever to reading a book.

    This way of interacting was working well up to this point. Now I am finding that if a player is in more than one trigger collider at once two things will happen. It is confusing and I'm not happy with it. I am quite keen on not resorting to pointing and clicking on objects as if they are buttons, but I cannot think of how to make an interaction that will only appertain to one object at a time without pointing and clicking. This was my thinking as I was originally determined not to have a cursor on screen. A cursor would detract from the immersion I want to create.

    Another problem I have found with the method of using trigger colliders and the right mouse button, is that a player can right mouse click at an item, but a completely different item interacts that the player did not realise they were interacting with, as a player could be in the trigger collider for one object, thinking a separate object is intractable. I tried solving this issue by attaching a glowing material to the intractable objects and it works fairly well, but maybe there is a better way of achieving this.

    How would you design interactions in a first person environment? Is using trigger colliders a bad idea? I am starting to think it is. I had intended my players to only need W-A-S-D, Up-Down-Left-Right and the mouse with left click to swing their weapon and right click to interact with objects.

    I hope this is the right place to post this thread (if not please move it), but "Game Design" seems appropriate for the topic of interactions in a first person environment.
     
  2. kittik

    kittik

    Joined:
    Mar 6, 2015
    Posts:
    565


    The above is an example of a mouse interacting on an important object in Legend of Grimrock, which is fine, but if possible I would have no cursor whatsoever.
     
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    How about this: Use OnTriggerEnter to keep track of all the potential objects that the player can interact with. In Update(), check each object's distance from the player's center of screen. Target only the closest object.

    Once you get this working, you can move the distance check to a coroutine and run it less frequently, like maybe every 0.1s.
     
    kittik likes this.
  4. RockoDyne

    RockoDyne

    Joined:
    Apr 10, 2014
    Posts:
    2,234
    This is so wrong on so many levels. For one, immersion is a state where the controls no longer matter; they're effectively invisible. It's a state where the player is engrossed and engaged with something beyond the mechanics of the medium. Immersion and engagement are far more dependent on aspects like atmosphere, story, and characters that build the world. If you are really worried about immersion, then the important questions to ask are A) does this mechanic enable the player to interact with or perceive more about the world, and B) do the mechanics work efficiently. If you can't deliver on the both of those, then the likelihood that players will be immersed is pretty unlikely.


    Why not use a normal first person controller? Make the player look at whatever they're going to interact with.
     
    kittik and Gigiwoo like this.
  5. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    12,697
    Modern first-person games are a little more forgiving. You can look in the general area of an interactable and it will select it. You don't have to get the centerpoint of the screen exactly aligned with the interactable. The distance check I described above will handle that.
     
  6. Gigiwoo

    Gigiwoo

    Joined:
    Mar 16, 2011
    Posts:
    2,981
    Have you considered the Player's Perspective? It's a part of simplicity. And, I think having a mouse or not is unimportant, as long as you are always keeping things simple from the Player's Perspective. Thinking like them is challenging, and worth it.

    Gigi
     
    Last edited: Jun 4, 2015
    Deleted User, theANMATOR2b and kittik like this.
  7. Kiwasi

    Kiwasi

    Joined:
    Dec 5, 2013
    Posts:
    16,860
    Distance check + view direction check + highlight currently interactable object.

    Lego Star Wars is a good example of interactivity done right.
     
    theANMATOR2b and kittik like this.
  8. kittik

    kittik

    Joined:
    Mar 6, 2015
    Posts:
    565
    I'll have a look at Lego Star Wars let's plays. I suppose a cursor would be the most sensible way to interact - considering that is what PC users are used to.

    Thanks to all of you for the advice.