#footsteps

1 messages · Page 1 of 1 (latest)

sweet dock
#

Are you ok with a thread? I'll send the other scripts

quartz oar
#

I do have to run out to go to work in 10 min

#

i can try tho

sweet dock
#

I appreciate any help. I want to learn.

#

This is the script on my terrain

#

This script is on my player

quartz oar
#

which one is the slope detection n such

sweet dock
#

This was added to my PlayerMotor script

sweet dock
quartz oar
#

i think I sent you example of the line of code for it

sweet dock
#

Am I able to drawline in a step method?

quartz oar
#

yeah ofc

dusk cedar
#

you can

#

and please dont rely on try catch

quartz oar
#

those try catches are nasty esp nested like that

sweet dock
#

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

dusk cedar
#

it works but the ray only appear for a frame

quartz oar
#

they're both called in Update according to ur code

#

yes make sure u put lengths above 10or sum

sweet dock
quartz oar
#

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^

sweet dock
quartz oar
#

ideally you would debug.log also the name of what you're hitting yes?

sweet dock
#

I was trying to cast a line. I think I'm burnt out from the footstep stuff hah

quartz oar
#

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

sweet dock
#

I've added a debuglog for when it hits and it doesnt hit when going up the bloody hill

quartz oar
#

not hitting the slope or anything at all?

sweet dock
#

going down yes. going up no

quartz oar
#

are you sure its not hitting something else like the player or something ? printing the name of collider/what u hit helps

sweet dock
#

so printing is better than debug when it comes to things like this?

quartz oar
#

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

sweet dock
quartz oar
sweet dock
#

it isn't hitting anything when going up

#

going down

quartz oar
#

if its inside the ground that could be a potential issue

#

raycast doesnt like to detect if starts inside the collider

sweet dock
#

starting point (saying this. should i be getting the collision debug for the wood it's hitting)

#

This is my foot object

quartz oar
#

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?

sweet dock
#

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?

quartz oar
#

make sure collider is also big enough

sweet dock
#

Never done anything with Gizmos

quartz oar
#

^ this function also runs in editor so if foot was null / not assigned, it would throw errors

sweet dock
#

Thank you.

#

What exactly is this used for?

#

just to show the start point?

quartz oar
#

make sure Game view gizmos is enabled too

sweet dock
quartz oar
#

very powerful tools gizmos

sweet dock
#

hope that made sense

quartz oar
sweet dock
#

By that, do you mean if the transform is staying in the same place? aka on the player as I move?

quartz oar
sweet dock
#

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

quartz oar
#

as long as origin starts above it. / outside of it then its fine

sweet dock
#

it starts above. yes

quartz oar
#

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

sweet dock
#

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.

quartz oar
sweet dock
sweet dock
#

I've ended up scrapping that code

#

got something semi working