#My code works until...
31 messages · Page 1 of 1 (latest)
Alright
Local ray1 = workspace:raycast(humanoid,mouseposition)
— then there’s a check abt the ray magnitude and if ray magnitude is <101 then a function is fired
stickmaker(same positioning values as used for raycast)
— stickmaker basically never fails to do its job, all it does is put a part at the ray destination. Next, for the line that kills my code…
HRP.position = hrp.position + (the ray position -hrp position) * 0.5
And so what it should do (it does do this)
Is move the human to the destination.
However, after this the ray casts stop working and it really bugs me
bcs they r quite unrelated lines I would think
?
What did I do wrong
is it just mouseposition-humanoid position
as direction
right
why did you put humanoid
anyway
it takes origin and direction
what's mouse position
the mouse position?
Mouse.Hit
and by humanoid I meant the hrp position
Also u were right and it’s made my script a lot better but it’s now gone from working 1% of the time to 50% of the time
I appreciate it tho
cos now I’m getting somewhere
you need to unit the direction and multiply it with the desired magnitude
or else it stops looking at whatever the natural magnitude of the direction is
alright im trying that rn
bro thank u so much
man im dumb with raycasts + i figured out what was going on
yes no problem