#footsteps
1 messages · Page 1 of 1 (latest)
I appreciate any help. I want to learn.
This is the script on my terrain
This script is on my player
which one is the slope detection n such
I believe it's the last one I send?
did you try also debugging all the rays including if hit draw line from origin to hitpoint
i think I sent you example of the line of code for it
Will do that now
Am I able to drawline in a step method?
yeah ofc
those try catches are nasty esp nested like that
okay. Just asking because I couldnt get the Drawray to work in the step event but worked as soon as i put it in update
it works but the ray only appear for a frame
they're both called in Update according to ur code
yes make sure u put lengths above 10or sum
It does look bad. I spent a few days trying to find tutorials but most are old or expanding on scripts they dont show
try catch is good ime when you're doing some network calls /api stuff
in unity I never find myself using them except for above^
I'm having a bit of trouble with this
in what sense exactly?
ideally you would debug.log also the name of what you're hitting yes?
I was trying to cast a line. I think I'm burnt out from the footstep stuff hah
hmmm maybe take a short break, come back to it later with fresh mind, start adding debugs to all the conditions to double checks them
debugging takes more energy than writing the code lol
I've been trying to do this for about 2 weeks. I've ended up using a unity asset and do not know what half the code means which I'm not too happy with.
I've added a debuglog for when it hits and it doesnt hit when going up the bloody hill
not hitting the slope or anything at all?
going down yes. going up no
are you sure its not hitting something else like the player or something ? printing the name of collider/what u hit helps
so printing is better than debug when it comes to things like this?
Debug.Log is the same as Printing
they're all Debug class function like Debug.DrawRay
then there is also Gizmos which you can use to create more complex shapes like Box
OnDrawGizmos
I searched that and got the same answer. :p I have seen print been used sometimes
iirc print does not work outside monobehaviors but debug.log is a static class so it can
gotcha
how far is the raycast orgin from the ground
if its inside the ground that could be a potential issue
raycast doesnt like to detect if starts inside the collider
starting point (saying this. should i be getting the collision debug for the wood it's hitting)
This is my foot object
looks ok here
also dont be hesitant to use what is sent Debug.DrawLine(foot.position, hit.point, Color.yellow, float.MaxValue);
to get the exact display of where that ray is hitting
is that platform the only one that is with issue or else where in map?
I havent done anything with the platform. just the terrain at the moment. Let me add and see if the platform works
right. So I added this
the only time the sound works is when i drop from the dock to the cube
so downward motion?
i would add gizmos also in the start point of rays so you can see if they ever go inside collider or something?
make sure collider is also big enough
I'll have to look into that.
Never done anything with Gizmos
private void OnDrawGizmos()
{
Gizmos.color = Color.magenta;
Gizmos.DrawSphere(foot.position, 0.35f);// any size, size of 0.35f is ok
}```
^ this function also runs in editor so if foot was null / not assigned, it would throw errors
in this case yes so you can see them while ur moving
make sure Game view gizmos is enabled too
Thank you very much. I can see many uses for this
very powerful tools gizmos
This is the same as seeing the Debug.DrawRay in game view ? What I mean by that is I could see the ray was following the player. This has just made it so i can see where my transform in the scene view which is awesome.
hope that made sense
kinda yeah , just an extra tool to have.
btw are your origin always staying where they need to ?
By that, do you mean if the transform is staying in the same place? aka on the player as I move?
yeah like its not going inside a collider or anything?
it isnt. no. only thing going inside is the ray. I'll show you
hard to see but that's the only time it goes into the ground. when i go of the dock onto the island
as long as origin starts above it. / outside of it then its fine
it starts above. yes
yeah i would revise that entangled try catch there is a condition that isn't hitting
you really don't need those in this case tbh
not saying its the culprit per se just another way to clean away confusion/possibiles
I gotta run out to work though
Hopefully you'll make progress on this one
I really appreciate everything. I do not know where to even start to be honest. I just really dont understand how it works one way and not the other
I hope you have a good day at work and thank you again. I really do appreciate it.
Thanks! do take brakes often to let mind work on the problem behind the scenes. something will come up
debugging is very key to this.
Dont hesitate to post again in a bit on the code channel so everyone can see it again!
Goodluck! 
Thank you. I'm using game making as an escape right now so hence why I'm spending a lot of time doing it 🙂