playMaker

Author Topic: [SOLVED]RayCasting with playMaker  (Read 2754 times)

Martin-Vaupell

  • Junior Playmaker
  • **
  • Posts: 70
  • Creating CarbonDiOxide
    • Evisystems
[SOLVED]RayCasting with playMaker
« on: December 23, 2013, 06:30:06 PM »
Objective>

Get a stationary turret to turn with a red lasor (line renderer)
And rayCast detect for tag "player"

Model, lineRenderer, rotation is working as intended.

However, raycasting is not.

Issue>

Raycasting should go from center of turret "from position 'none'"
and to the INVISIBLE gameObject which is rotating around with the lineRenderer
and that is what im getting positioning from in steps 1,2 on the image below.
But raycasting is not initiated, and or not working, not sure.

Image explanation.>

Center with playMaker logo is the turret iself, just a model.
from the turret to the right "redish" line is the lineRendere. <----- NOTE!
the LineRendere is the one where i have the "raycasting FSM on,
and that is what is shown on Image.

Steps>

1 - get current frame position of invisible gameobject marking "end of lasor"
1a saving the coordinates as eolx,eoly,eolz
2 - converting the coordinates into vector3 named eol
3 - initiate raycast from "none" i would exspect that to be model center/joint
4 - get the coordinates from pkt 3 and sets the direction, ignoring distance for now.
5 - enabled debug mode, which should draw, but nothing is drawn.

BTW - Those boxes are in the layer "testRay" so it should detect them.

CLICK THE IMAGE!!

CLICK THE IMAGE!!



So guys,  What do you think may be my major mailfunction here ?

I'm now going to move the entire FSM onto the model instead of the
lineRenderer, but don't think that would / should make any difference.


Im up for trying anything, even crazy ideas just let me know ;)
« Last Edit: December 23, 2013, 06:40:38 PM by VaupellAgainNoMailReceive »

Martin-Vaupell

  • Junior Playmaker
  • **
  • Posts: 70
  • Creating CarbonDiOxide
    • Evisystems
Re: [SOLVED]RayCasting with playMaker
« Reply #1 on: December 23, 2013, 06:41:52 PM »
SOLVED


Well lol,,  no need to "reset" the vector3 a secound time,
Just by saving the initial coordinates in the Get pos, made it work.

So it was all about the coordinates.  LOL   foolish mistake.

Thanks anyway..