Does RaycastResult have direction?

1 Like

“Normal” is the direction coming off of the surface the ray hit if thats what you mean
If you mean the direction of the ray, you would have already provided the direction of the ray when you made it

1 Like

But how do i convert the position values to an orientation value??

To calculate the LookVector you would do

local lookPosition = (LookAtPosition-OriginPosition)

but how do i make thet into a unti vector, and then into an orientation vector.

That would be the unit vector.

Could you explain what you are trying to do?

I need the direction from one point to another to move a humanoid. Since it uses direction I can’t use a lookvector.

As I said above, the direction would be calculated as

local lookPosition = (LookAtPosition-OriginPosition)

But that’s a lookvector, not an orientation measured in degrees.

If you are trying to make the character face a position you would do

local characterPosition = character.PrimaryPart.Position
local lookAtPosition = Vector3.new(0,0,0)

character:SetPrimaryPartCFrame(CFrame.new(characterPosition,lookAtPosition))

This would make the character look at 0,0,0

Humanoid:Move() makes the humanoid move in a direction, specified in degerees, i need to get a direction from the two position values. a

https://developer.roblox.com/en-us/api-reference/function/Humanoid/Move

This is probably the misconception, you can just use the raw ray direction for humanoid:Move()

Yes. for a third time, to get the direction you would do

local lookPosition = (LookAtPosition-OriginPosition)

So, is the direction in studs or degrees?

It would be in studs, representing a vector/line with an x y and z length in each direction

So like 5,0,0 would be moving 5 studs/sec in the x I think, unless theres a different speed

1 Like

Thank you :pray:
I got it to work.