playMaker

Author Topic: Triggering what player is looking at, not actually entered[SOLVED]  (Read 1845 times)

willoneill

  • Playmaker Newbie
  • *
  • Posts: 3
Hey everyone,

Trying to think of how best to approach this problem. In my game, you control a character from a third person perspective. You go up to objects and interact with them. Currently, I do this by having trigger zones 'listen' for players coming near each object, and activating when the player moves into that listening zone.

The problem, though, is that several of the objects are too close together, so when the player is near one of the them they are also near all of them! What I would like to do instead is have the object trigger when the player 'looks' in the direction of it. That would fix this and also make for a better interface.

How would I go about this? I feel like maybe it has to do with raycasting, i.e. having a ray shoot forward out of my characters face that 'hits' the object and activates it, but I don't know how to go about doing this, and would appreciate help (or any other solutions!)

Thanks!
« Last Edit: July 29, 2013, 05:42:57 AM by jeanfabre »

willoneill

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Triggering what player is looking at, not actually entered
« Reply #1 on: July 23, 2013, 06:37:30 PM »
I have exciting news! I figured this out.

It did indeed involve raycasting. And some variables.

I'm starting to really get my act together over here.

Bqlqzs

  • Junior Playmaker
  • **
  • Posts: 52
Re: Triggering what player is looking at, not actually entered
« Reply #2 on: July 24, 2013, 11:46:35 AM »
Hello

I dont know what you want, if you can, write a simpler.

But If you want get the object, what are you looking at realtime, you can
use the Mouse Pick Action.

This action can get the targeted object and save in to object varriable.