#weird block jump glitch

1 messages · Page 1 of 1 (latest)

twin jackal
#

welp

silent kindle
#

do you spam the space bar when jumping?

twin jackal
#

no im just holding it

silent kindle
#

use get keydown

cold sentinel
silent kindle
#

i mean it solves the spam , but not the glitch

twin jackal
#

no difference

#

yea fsdjkhsfd

cold sentinel
# twin jackal no im just holding it

ok for the isGrounded thing, lets just do something to see where it was grounded.
Add this

        isGrounded = Physics.CheckSphere(groundCheck.position, groundDistance, groundMask);
if(isGrounded){
  Debug.DrawRay(groundCheck.position, Vector3.up, Color.red, 1f);
}

typed on discord so lmk if any errors

#

actually change the direction so its not up, do like -Vector3.forward and increase 1f to maybe 5f

silent kindle
#

why not use the isgrounded default by charact controller?

cold sentinel
#

and just to note: if you follow any of keni's suggestions im gonna go to bed because its a waste of time

cold sentinel
#

does that one not work, im just typing on discord so idk the exact code off hand

twin jackal
#

i mean

#

is it not just the same as Vector3.back sdfhjksdfkhj

cold sentinel
#

yea it is

#

again, just typing this on discord. I dont remember every property of vector3 😛

silent kindle
#

oh i think the block (wall) is triggering the igrounded to true

twin jackal
cold sentinel
#

i assume if you rotate the camera, none of those are in the air

#

but check to be sure, not having depth perception is a rough thing

silent kindle
#

is it in th stone block?

#

cant see

twin jackal
#

they're in the air but only because my player is a little capsule guy and so he is also floating in the air

cold sentinel
#

Are you sure friction didnt work, when i suggested it (in the middle of keni repeating bounce), i never asked if you set the friction combine to "minimum"

silent kindle
#

just a question holo, did you try the isgrounded by character controller??

twin jackal
#

does the physic material have to be on both the player AND the mesh? or just the player

cold sentinel
#

Just the player

silent kindle
#

player

twin jackal
#

okay thank god

#

what friction values should i use?

cold sentinel
#

im just hesitant to suggest this because you said you put it on the player and mesh before and it didnt work

#

0

#

friction really is a pain in unity lol

twin jackal
#

i did but i didn't set it to minimum (im really a noob when it comes to physic materials sdfjkhfd)

cold sentinel
#

the minimum is between collision

#

if its on the player and mesh, both with 0, the average is 0

twin jackal
#

same result as before unfortunately

cold sentinel
#

can you show how you set it

twin jackal
silent kindle
#

try lowering the value of radius of the checksphere

cold sentinel
#

ok tbh what I would do at this point, assuming there isnt any other code in the project, is add debugs to log whats affecting the velocity.
Like a debug after every possible change in velocity, then get the bug once and go through those debugs

silent kindle
#

so thats why we cant solve it

twin jackal
cold sentinel
silent kindle
twin jackal
#

when the player gets bugged downwards

#

it's physically impossible for the checksphere to collide with a vertical wall because the radius is way smaller than half the width of the player

zenith beacon
#

Mmh.

I'm not very familiar with characterController but I wonder if splitting the vertical and horizontal move like that could cause it to somehow fight for control with itself.

If you could somehow combine the two and use .Move just one per update loop, I wonder if it'd do anything differently.

But I'm kinda grasping at straws here.

cold sentinel
#

Damn I was about to type that too I just noticed u have 2

silent kindle
#

welp the last thing i can recommend is to use isgrounded for character controller

cold sentinel
twin jackal
#

i really hate writing movement code sfdjkhsfdh

cold sentinel
#

I thought it was one move, which is why I said debug just the y component

twin jackal
#

vector2 for x and z only or vector3?

silent kindle
#

i think because of this

if(isGrounded && velocity.y < 0)
            velocity.y = -2f;
twin jackal
#

the velocity variable already is a vector3

cold sentinel
twin jackal
zenith beacon
#

Yea controls that don't use .AddForce can be pretty challenging to get right.
But also lead to snappier movement. Mh.

silent kindle
twin jackal
#

im not gonna lie to you guys, i removed it and that changed nothing

#

my movement is the exact same as it was before

silent kindle
#

u sure the isgrounded trigerring the floor not the wall??

twin jackal
#

wdym a normal block collider?

#

like a box collider?

#

genuinely not possible with the setup i have sdfjkhsdfh

#

my chunks are 1 whole mesh

#

(made that way so that inside faces don't have to get rendered)

cold sentinel
#

That should still be fine as long as the collider bounds are proper.

#

And much more performant than having a bunch of split meshes

twin jackal
silent kindle
#

what u mean

cold sentinel
twin jackal
#

this is one of my chunks

#

its a single mesh

#

one mesh, one collider, everything

cold sentinel
#

Also seems like this thread has somehow gone off topic. I really dont wanna be bothered correcting other peoples incorrect solutions

twin jackal
#

💀

cold sentinel
#

My final suggestions are combine the movement to 1 controller.move
If that doesnt work, print what the y component is and try to manually catch out when the value isnt what it's supposed to be.

silent kindle
#

yea try charactercontroller.isgrounded because it works different than checksphere

twin jackal
#

oh wait

#

no i see what u mean

#

right

#

gotcha

cold sentinel
# twin jackal do i just add them together?

You would need to combine the vectors into one. Have a vector for your horizontal movement, multiply that by speed.
Add your y component after, so it's not multiplied by movement speed

zenith beacon
#

I'm kinda confused by how it's seemingly unaffected by you commenting out the bit that sets velocity for faster fall.

Uh. Is your character's RB's gravity set to 0?
Or is it using both physX gravity and your own at the same time?

...but yea I still think combining the moves might make a difference, as I said earlier.

zenith beacon
#

Rigidbody

silent kindle
#

rigidbodty

twin jackal
#

im using a character controller not a rigidbody sdfjkhfsdh

zenith beacon
#

Oh right, it takes it's place my bad.

silent kindle
#

i think u shouldnt combine controller to rb

cold sentinel
#

Again, bunch of off topic clutter in a thread for someone trying to get help

silent kindle
#

gravity on rb wouldnt work either

twin jackal
#

i am doing that combining thing you said though so nw

#

@cold sentinel ahh! thank you it worked :]

cold sentinel
twin jackal
#

ahh sorry sdfjkhsdhf

cold sentinel
#

I charge 30 usd/hour for lessons with personalized plans

twin jackal
#

😱

silent kindle
#

💀

cold sentinel
#

I do tutor, scamming 30 isnt worth when I could just tutor and make 300 lol

#

Yes I'd rather not commit a literal crime. If you are serious then send a dm request. I'll get to it later because I'm going to bed

cold sentinel
#

This isnt the place to discuss, dm if you are serious. Otherwise dont waste time please