playMaker

Author Topic: Raycast from position not working  (Read 6952 times)

inyourbus

  • Playmaker Newbie
  • *
  • Posts: 43
  • In Your Legends
    • In Your Legends
Raycast from position not working
« on: April 18, 2015, 08:39:12 AM »
When i try to change the From position in Raycast it fails to change position.

Why is this?

Unity 5.0.1 and the latest version of Playmaker, is anyone else having this issue?
One step at a time..

inyourbus

  • Playmaker Newbie
  • *
  • Posts: 43
  • In Your Legends
    • In Your Legends
Re: Raycast from position not working
« Reply #1 on: April 18, 2015, 08:53:40 AM »
Heres a video of it not working.

http://take.ms/Nym1g
One step at a time..

inyourbus

  • Playmaker Newbie
  • *
  • Posts: 43
  • In Your Legends
    • In Your Legends
Re: Raycast from position not working
« Reply #2 on: April 20, 2015, 06:31:10 AM »
Still not working.

Any info/help?
One step at a time..

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Raycast from position not working
« Reply #3 on: April 20, 2015, 08:10:42 AM »
That parameter is not an offset. You can use either an explicit world position or the Game Object reference.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

inyourbus

  • Playmaker Newbie
  • *
  • Posts: 43
  • In Your Legends
    • In Your Legends
Re: Raycast from position not working
« Reply #4 on: April 20, 2015, 09:44:40 AM »
Hi Lane,

Is that the way its always worked?

I have used this to change the position of the raycast start point in the past I am sure.

Am I correct that this is not the way it works in Raycast 2D?

As this video shows - http://monosnap.com/file/9IAZhmILe8267HxjN5TCtKHZ9qlvfj


If this is not a bug then how do I choose to offset the position of the raycast start point?

I don't want the ray to start in the 0,0,0 of the Object I am trying to cast from.
« Last Edit: April 20, 2015, 09:52:39 AM by inyourbus »
One step at a time..

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Raycast from position not working
« Reply #5 on: April 20, 2015, 10:07:28 AM »
It isn't a bug, they're coded differently. Raycast disregards the vector if you have a GameObject in use whereas Raycast2D does not.

This was likely something Jean added intentionally in Raycast2D when he made the actions since it was done when the 2D stuff was released in Unity whereas the original Raycast action was made in ~2011.

You can use a position. Just grab the target GameObject's position, add your offset, then inject that Vector3 as the origin.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

inyourbus

  • Playmaker Newbie
  • *
  • Posts: 43
  • In Your Legends
    • In Your Legends
Re: Raycast from position not working
« Reply #6 on: April 20, 2015, 11:30:05 AM »
Ok, thanks for the info.

Its seems counter productive but I am sure there is a reason that I don't understand to why this is necessary.

Thanks for your time Lane.

Have a nice day.
One step at a time..

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Raycast from position not working
« Reply #7 on: April 20, 2015, 11:39:04 AM »
The reason its not updated is because changing the Raycast action will affect everyone that updates and that would change the behavior of their existing Raycasts, which is a maintenance problem that should be avoided. Suddenly everyones Raycasts could be offset because we added a 'feature'? Not good.. Raycast2D was a new action and didn't have this hazard.

Just some clarification.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D