# Unity 3d Raycast from localspace to worldspace

I want a raycast direction not relative to the rotation, but what happens is that the raycast points to one place as if it was a transform.forward

Why is the happening help


if(Physics.Raycast(transform.position, vector3.forward, out hit, SupportedDistance, CanBeSupported))
{
NotSupported = false;

//
}

• I'm sorry but I don't understand your question. What do you want to achieve here? A Raycast from an object and pointing to a specific object? – lvictorino Oct 24 '19 at 18:34
• The code you've shown here (neglecting the incorrect capitalization) fires a ray in world space. If you are observing symptoms that make it appear as though it is not using world space, then you should walk us through the complete steps we need to reproduce these symptoms in a new Unity project. Tell us exactly how to set up the test scene, what output you expect, and what output you observe instead. – DMGregory Oct 24 '19 at 22:47
• Yeah i think i fixed it. I was overlooking again : ^ ) my apologies and thanks for the help still. – Dan-mechanics Oct 25 '19 at 8:46