#Detect an angle through collision
1 messages · Page 1 of 1 (latest)
this is related to the player btw so it should run in a local script
i have looked everywhere and i cant find stuff
You would need to create a server script to detect when the player hits an object
then get the objects position - players position to get forward vector between the wall and player
raycast forwards from primarypart of character upon touching
then get raycast.Normal
you do not need a server script, because this is client-sided movement
that would just increase delay between jumps by about two frames or more
unless of course you are using server-authenticated movement, but nearly no game on roblox does that
i mean that would be the way of detecting the part's angle, yes
but i need the angle of the specific face
since parts have 6 faces
blocks have 6 faces
raycast will still give you the correct angle
you just have to convert it from the normal
oooohh
I don't get what your trying to achieve exactly
Could you elaborate
get the angle corresponding to the direction of a mesh's face
player collission with part, script receives the angle of the side the player just touched
** You are now Level 1! **
yay !
You mean which face?
the face and the angle its facing
you can't get a particular face as there is no face object/id/etc. in roblox but you can get the angle at the point of intersection between a ray and a face
what i said earlier still stands just for clarification
ye between what and the mesh's face exactly
ooOOoooooo
not between, just the (normalized) vector that the face is facing
so like the point has the angle of the face, correct?
the point is on the face/polygon of the mesh, and the mesh's face more or less contains the necessary data to reconstruct the angle in which it is facing
it depends on the exact implementation, but i believe it's probably normal for the C++ backend to construct the face from triangle vertices
if you have no idea what i just said, that's fine, you don't need to know
lol okay
im assuming it works good with baseparts but not meshes?
bc i wasnt planning on using meshes at all so its fine that way
it works with everything
however if you mess with basepart fidelity it may affect raycast precision (i think, i haven't used roblox in a while)
Yup, since the objects in workspace hitboxes, will become less accurate or more accurate depending on the fidelity mode you have
fidelity ?????
say you have a really intricate mesh
like it's the whole harry potter castle
the collision will be precise, or it could just be a cube
that is what fidelity is
ooohh okai okia
im getting strange stupid errors
should include all this actually
CFrame:lookAlong(tor.Position, raycastResult.Normal) would work unless raycastResult.Normal is a table lol
i am a little confused as to why you chose to use torso but 🤷
oh wait
lol you did CFrame:lookAt
it's the colon
i dont trust the hrp that much
personal nitpicks tho