#Thread

1 messages · Page 1 of 1 (latest)

dry valley
#

Do it here

#

So the issue from what I can tell is your playerheight being 1.2f

#

and your debug sphere being at a different position to the checksphere

#

no, I don't know where you got 1.2 from

#

If you try it now with the new playerHeight variable it should work

#

?

#

Alright. remove that

#

Get your camera working again

#

Can you Ctrl + F and show me where playerHeight is used

#

How does adding that break your camera

#

yea

#

I dont get it

#

try enter 2 as the float for playerheight

#

isGrounded = Physics.CheckSphere(transform.position - new Vector3(0,0.5f,0), 0.3f, LayerMask.GetMask("Ground"));

#

try that

#

Yeah try that

#

Can you screenshot your players capsule collider

#

what do you have the script on

#

man, im so confused

#

?

#

yeah

#

do you have a vector3 or transform set up for your Feet Position

#

yeah

#

Alright, let's simplify this

#

[SerializeField] Transform _FeetPosition;

#

add that variable

#

isGrounded = Physics.CheckSphere(_FeetPosition.position, 0.3f, LayerMask.GetMask("Ground"));

#

Then drag feet position gameobject onto the script in the editor

#

try that

#

show me what they say

#

oh if it's not assigned then it's fine

#

I can only guess the transform.position for your player is off

#

it's always good to keep child objects 0,0,0

#

Yes, then move the parent back to spawn

#

It's pretty much essential for future coding

#

that's why the original code didnt work

#

Because where the capsule moved to is where the game was drawing the checksphere

#

What's your jump script

#

Show me the jump excerpt

#

bool readytoJump = true;

#

put that at the top

#

it's locked false

#

yea

#

no

#

wait

#

at the top of the script in your declaration

#

private void Jump()
{
print("Jumping..")
rb.velocity = new Vector3(rb.velocity.x, 0f, rb.velocity.z);
rb.AddForce(-transform.up * jumpForce, ForceMode.Impulse);
}

#

add a debug log to the Jump function and see if it gets called

#

no dont remove anything

#

just add a debug log to the Jump function

#

see if you 'can' jump

#

Does it say Jumped in console

#

use the search function

#

so it's working except maybe your force is too low?

#

Spam space too

#

wait

#

what's the purpose of that line

#

and remove that

#

the little -

#

sweet