playMaker

Author Topic: Look At Direction appears to have some odd results  (Read 7676 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Look At Direction appears to have some odd results
« Reply #15 on: October 17, 2013, 01:29:38 AM »
Hi,

 Ok, I get it now...

 You are mistaken the meaning of the action "SmoothLookAtDirection". It looks at a direction, not a target. For this you need smoothLookAt,

 a "Direction" is not a position in space, it's a direction as "angles". So putting the position of the target in this "direction" property, mean that you will use the position as an indication of the direction compare to the center of the world. To witness this, grab the target cube and rotate it around the center of the plane, you'll see that the "smoothLookAtDirection" understand this as the angle between the center of the plane and your target.

 Hope that make sense.

bye,

 Jean

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: Look At Direction appears to have some odd results
« Reply #16 on: October 17, 2013, 01:59:46 AM »
So if I say wanted to have my enemy unit navigate around a hallway to find it's target, if I just use a Look At it will look across the map independent of it's position to the hallways. What would be the best way so it will always look forward as it's navigating the hallways to it's target destination? For instance, if I was going to navigate from my bedroom to my office in my house, I'm not just going to have my head facing my office, it will face forwards as I walk across the room to the door to the next room.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Look At Direction appears to have some odd results
« Reply #17 on: October 17, 2013, 05:24:17 AM »
Hi,

 For this, you need a pathfinding system, that will find the path to the target, and then your character is going to look in the direction of the path as it walks. Any other way means in practice building a pathfinding system of some sort.

bye,

 Jean

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: Look At Direction appears to have some odd results
« Reply #18 on: October 17, 2013, 11:14:44 AM »
So I've been using A* for pathfinding which generates that path, and my game object will translate it. However there is to my knowledge no way to expose the points on the node to look at, nor a way to say "if you've reached node 1 on path, look at node 2". The problem is that the character when set up exactly like this, doesn't look in a forward direction. Any thoughts?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Look At Direction appears to have some odd results
« Reply #19 on: October 17, 2013, 11:18:23 AM »
iirc there is some 'orient to path option' in the A* settings.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: Look At Direction appears to have some odd results
« Reply #20 on: October 17, 2013, 12:19:59 PM »
There is or isn't? I'm looking at my A* now and can't seem to find that option on the Astar Path script.

mweyna

  • Full Member
  • ***
  • Posts: 242
Re: Look At Direction appears to have some odd results
« Reply #21 on: October 18, 2013, 02:29:48 AM »
With help from Kiriri, appears that my order was wrong on my problem. When using A* the Look At Direction action needs to follow the MoveTo, not appear ahead of it. Consider this issue SOLVED.