#Dash with char:MoveTo (SOLVED)
1 messages · Page 1 of 1 (latest)
by weird interaction with walls i mean sometimes dashing through or to the top of the wall
this is the cutoff line btw char:MoveTo(Pos + Vector3.new(direction.X * ((10 * (i-1)) + (direction.X * (dist - 0.2))), -2, direction.Z * (10 * (i-1)) + (direction.Z * (dist - 0.2))))
Either Humanoid:Moveto decides you can step over the wall or the physics teleports you there because of collisions. If it is the Humanoid:MoveTo, simply teleport by CFrame, then that lil jump, clamp the Y position so it stuck to the ground.
other wise teleport a lil before the wall, or slightly off the wall, you could simply have ur raycast length cover that "offset" distance
dist is the raycast.Distance
and in the moveto formula i subtracted it with 0.2
doews that not work?
yeah, teleport like dist - 0.5
** You are now Level 9! **
yeah
ur formula basically says direction.X^2 * 0.2
which isn't like linear so ur offset will get smaller over the distance
so it aint offsetting 0.2 no matter what the dist it
yeah but you can't just subtrack the Vector3 mind you
its lowkey tricky without experience with vectors but u can figure it out, else I'm here ig
does this work?
i mean i am subtracting the distance which is a num value
the distance and everything other than direction is basically multipliers
and the direction itself is converted to numval through .X and .Z (not using y value for now)
y is at -2 cuz of the dash abit up thing
i tested it just now and its around the same effect
the worst thing about the bug is that its super inconsistent
sometimes it works sometimes it clips
and because of that i cant really pinpoint whats happening
yeah its just slight things, on the left expression, (direction.X * 10 * i - 1) is that you should direction.X * (10 *(i - 1)) so that you can dash 10*(i-1) studs foward
that should work i think.
sorry the formula works its just I wouldve instead, got the unit vector and multiply it by your dashLength which would be the dashLength = (base + dist - 0.2)
but like it works
If ur still gonne use MoveTo you might have to increase ur margin
the problem is still here...
try increase ur margin(0.2) before trying the teleport to CFrame
and be sure to apply the changes to ur Z too 💀
lol nice
OK
** You are now Level 14! **
YES
it works?
lol nice
it still goes up
and it can still go to top of walls
btw i've tested using anchor before,
I would just set the Y position to the starting Y position right?
the teleporting to the top isnt beacuse of my teleporting to inside the wall and roblox bringing me up
i mean that would just mean 0 really
since im adding into Pos which is essentially base
but since dash is going abit up i made it -2
which didnt change anything weirdly
also by going on top of walls it LITERALLY teleports to the top of the wall NO MATTER HOW TALL IT IS
you suggest i use cframe instead?
so I would, after the Move set the Position to the origional Y position
no u should be fine
although I wouldve, I just dont wanna change ur code
hmm
alright i'll try that
DE.
DUDE.
THAT IS HILARIOUS
IT WORKS
IT FIXED BOTH ISSUES
oh lol nice
THANKS SO MUCH MAN
I was afraid it wouldn't
well if you should you can consider using like a tween and CFrames
ah i've tried using tween before
well not on this script
but for some reason when the player dies it like
gets offset or something?
im not sure what its about but i just avoid using tweens now
on characters specifically
and i tried cframes at first, some guy suggested i use :MoveTo instead tho
oh it may be because of fall damage I would imagine
you'd prolly have to just disable fall damage during it
ofc, goodluck with the rest
i dont have fall damage but meh
lol thanks for telling me, ig I have some research
oh boy.
ok
the clipping is back
i've tested, its because the raycast isnt detecting the wall for some reason?
and the serverside character is offset up
so like they're floating
Dash with char:MoveTo (STILL UNSOLVED)
might make a new post for this ngl
yeah mabye
Just tween?