Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: inyourbus on April 18, 2015, 08:39:12 AM

Title: Raycast from position not working
Post by: inyourbus 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?
Title: Re: Raycast from position not working
Post by: inyourbus on April 18, 2015, 08:53:40 AM
Heres a video of it not working.

http://take.ms/Nym1g
Title: Re: Raycast from position not working
Post by: inyourbus on April 20, 2015, 06:31:10 AM
Still not working.

Any info/help?
Title: Re: Raycast from position not working
Post by: Lane 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.
Title: Re: Raycast from position not working
Post by: inyourbus 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.
Title: Re: Raycast from position not working
Post by: Lane 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.
Title: Re: Raycast from position not working
Post by: inyourbus 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.
Title: Re: Raycast from position not working
Post by: Lane 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.