#Game
1 messages · Page 1 of 1 (latest)
ok i named it player
the one u just showed me
oh so i select it there
you need to add the player in it to be ignored.
the ray wont know player is in a different layer unless you add him there
ok so just the parent
and by parent i mean the player gameobject
not the raycastpoint thats a child of it
doesnt matter it doesnt have a collider
ok
it will be ignored anyway
so ive done that
you add the field to your raycast
and add Default layer in the inspector for the script
but not player layer
right, did you add HitCollider on the raycast 2d ?
cuz u didnt add the layermask filter
public static RaycastHit2D Raycast(Vector2 origin, Vector2 direction, float distance = Mathf.Infinity, int layerMask = DefaultRaycastLayers, float minDepth = -Mathf.Infinity, float maxDepth = Mathf.Infinity); ```
dont copy this
that is the signature for layermask
yes
for layermmask
you only need distance before it
and ur done
idk what the maximum amount would be
usually 1 or less works
oh
thats up to u
yea but the thing is i cant visualize that, usually it helsp to understand through visualization but this is pretty new to me
so
yea
exactly
but i sent u a link
to debug.drawline
which you add those same values to as ur raycast
or debug.drawray sory
you add the same values as ur Raycast2D
and you visualize it
the float is duration on screen, but if you multiply direction with * maximumlength from 2d ray
u can see it
why did u write it different than ur raycast 2d..
idk where to put it
its not about where to put it
i though tit was gonna draw a ray
but it didnt
but you still need the correct values
did you get it
nope
eh its fine
ill learn this some other time
its getting late for me anyways
thanks for sticking with me tho
it was probably frustrating for you and i apologize but unity is still pretty annoying for me
nah i mean its fine i wanna save you the trouble
it was just an attempt anyways to see if i could make a simple platformer from scratch but still a few holes here and there
thanks tho
its no trouble
[SerializeField] Transform feetPos;
private void FixedUpdate()
{
Debug.DrawRay(feetPos.position, -feetPos.transform.up,Color.blue,1f);
}
```
thats to see it