#wall stuck

1 messages · Page 1 of 1 (latest)

little frost
#

.

deep spade
#

Alright

#

so, i cant put it into the colider

little frost
#

show the inspector for the collider.

deep spade
#

im trying to drag it onto it

little frost
#

that is not a collider

#

that is a Rigidbody2D

#

ah, but it does have a Material

deep spade
#

still not working

#

on box colider / capsule

little frost
#

did you create a 2D physics material?

#

show me the inspector for the material.

deep spade
#

there is only 1 physical material in create

little frost
#

That is a 3D physic material.

deep spade
little frost
deep spade
#

Oh

#

my bad

#

if i set it to 0.1 it slides down about 2 pixels per second

#

Going by that logic...

#

IT WORKS

#

Thank you so much, i've been fighting with this for 3 days straight

little frost
#

I do very little 2D, so I'm not sure if a high-friction surface and a low-friction surface results in low friction or high friction

deep spade
#

and been halting my team with it

little frost
#

You probably want some friction on the ground still

#

(unless you're already simulating friction by slowing the player down when they aren't holding a button down)

deep spade
#

Ok another thing

little frost
#

If the low ground friction is an issue, then you'll want to create a low-friction wall material and a high-friction ground material

deep spade
#

how do i make it so you can still wall jump?

#

or that if you hold it, for lets say 2 seconds you start sliding down

little frost
#

you could just set the player's y velocity to 0 for those 2 seconds

deep spade
#

and you can still glue yourself to the wall for a moment before that

little frost
#

or you could change the friction on the player's physics material

#

both would work

#

i'd probably do the first one

deep spade
#

Alright, how would i change the friction, it seems a bit more dynamic

little frost
#

make a new physics material 2D that's only used by the player

#

then just reference it in the player component and set its friction value

deep spade
#

Alright, thank you

little frost
#

I'm not sure if you'll need low wall friction and low player friction to get sliding

#

or if high wall friction and low player friction will slide

deep spade
#

i didnt set anything for the wall

little frost
#

ah, okay, so then it's the latter

deep spade
#

How about making 2 materials it would change betwene?

#

like 1 for still and 1 for sliding?

little frost
#

You could do that too

#

then just assign the relevant material

deep spade
#

What am i doing wrong?

little frost
#

what is the error?

deep spade
#

Thats the problematic part

#

it just doesnt work

little frost
#

i wonder what the default friction is on the defaultPhysicsMaterial

deep spade
#

I've added variables im using for the thing

#

0.4 i belive

#

i can set it to 0

little frost
#

make the materials public so that we can see them

deep spade
#

just that?

#

still nothing

little frost
#

the point is to be able to see them in the inspector

#

and to check their values make sense

#

I would just configure everything that way

#

don't create new materials at runtime

deep spade
#

Alright give me a moment

#

Wait a second, i should be changing the friction to 0 but to 1000 or sum

#

ok im dumb lol

#

i will rewrite it nicely as you said anyway

little frost
#

nah, pretty sure you just need things in the 0-1 range

deep spade
#

wait a second

little frost
#

well, now it's null...

#

you need to put something in it

#

create two physics materials and assign them

deep spade
#

alright got it

#

Ok another problem, now its 100 constantly even when on ground, should i just if it out using "ground" and "JumpableWall" tags?

#

Ok i think i only broke it further

#

Wait, but do i really even need to do that?

#

I can live without it and just adjust the friction so its fine without the glue part

#

Now just 2 last question,

  1. Why can i double jump after jumping off a wall
  2. How do i prevent players from just jumping straight up while on a wall
little frost
#

back from some errands

#

i would suggest logging when you go from "can't jump" to "can jump"

#

to show when it's happening