playMaker

Author Topic: line cast 2d  (Read 2992 times)

HeathClose

  • Full Member
  • ***
  • Posts: 226
line cast 2d
« on: March 23, 2017, 03:12:04 PM »
I am using pool boss to spawn and despawn platforms in a platformer, and line cast 2d only sees platforms that are already active in the scene... once the spawned ones are triggered to show up, line cast stops working on those newly activated ones... however, raycast seems to see them ok...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: line cast 2d
« Reply #1 on: March 24, 2017, 02:27:14 AM »
Hi,

 the action is using the Unity api as is, so there may be internal variance on how they behave for sure...

but are you sure the linecast it casting along the line you expect? maybe the start or end object is not set at the time of casting and the line is null or not at all where it should be. I would triple check this.

 Bye,

 Jean

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: line cast 2d
« Reply #2 on: March 24, 2017, 09:19:10 AM »
Hi,

 the action is using the Unity api as is, so there may be internal variance on how they behave for sure...

but are you sure the linecast it casting along the line you expect? maybe the start or end object is not set at the time of casting and the line is null or not at all where it should be. I would triple check this.

 Bye,

 Jean

i did... the yellow line just keeps rechecking to the ground check object (which I modeled off your unity platformer demo) when its on pool boss spawned platforms... and all i did was setup raycast with exact settings, tick off line cast, tick on raycast... and it works... rechecked and rechecked... line cast can't see pool boss spawned layers... raycast can... at least that's what's happening on my computer...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: line cast 2d
« Reply #3 on: March 29, 2017, 04:45:15 AM »
Hi,

 does your object have a 2d collider?

 Bye,

 Jean

HeathClose

  • Full Member
  • ***
  • Posts: 226
Re: line cast 2d
« Reply #4 on: March 29, 2017, 08:43:04 AM »
Hi,

 does your object have a 2d collider?

 Bye,

 Jean

Yes, capsule collider on the player and box collider on the floor...

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: line cast 2d
« Reply #5 on: March 29, 2017, 08:46:34 AM »
Hi,

 Line2D expected only 2d colliders, I think this is your problem. EveryAction Mentioning 2D work with the Physics2d engine, not the Physics3d engine, they are incompatible and do not work together not share common api.


Bye,

 Jean