Is there a way to create a relative starting position for ray?
Example being, a ray that shoots from in front of you and it’s origin being a little left of the player. Looking in the direction of your LookVector.
Doing something like workspace:Raycast(char.HumanoidRootPart.Position+Vector3.new(1,0,1),char.HumanoidRootPart.CFrame.LookVector*10)
Wouldn’t work.
I know with cframes you can multiply a number to get a relative position.
How would one do this?
sjr04
(uep)
October 13, 2020, 3:09am
#2
Roblox uses the right-hand rule, where you take out your right hand with the index, thumb and middle fingers perpendicular to each other and the index is pointed straight forward. This will represent the 3 axes of the world
[image]
Since the x-axis is facing rightward and the y-axis is facing upwards, you’ll have to make your right hand in a way where the middle finger is facing rightwards and the thumb still facing upwards. You’ll see that the index finger faces towards you and is not looki…
Basically just negate the Z, since negative Z is the front. Not even I know how this works 100%, but I just know you need to negate the Z lol.
Your example works, only that it starts a little bit behind you.
Yea I realize that the Z was wrong in my post. I got it mixed up. I just wrote it as an example.
I guess I’m a dum dum. I created a visualized ray, then messed with the position to make it actually correct. I guess it’s always relative when adding position.
Big oof for me. I need to learn my axes.
I’ll mark yours as solution since you were right. It does work.