Basic Movement Tweaks

This was a pretty quick lecture but one where we solved problems that you might not have seen yet. Did you have any difficulty with it that you’d like to discuss?

1 Like

The constant click to move bothered me early on and I’m used to older MMORPGs that implemented the click and hold to move so I actually went and did a little Google / Unity Docs research to fix that before the video! :smiley: @Rick_Davidson What is that Chrome theme you’re using, it looks lovely!

2 Likes

Good call. :slight_smile:

You might be referring to my chrome extension called “Momentum”. Its the one that gives me a nice image and opportunity to put in my top task for the day when I open a new tab.

1 Like

Very cool, I’ll have to check it out!

Hi! I have a problem with the movement, everything works fine only changing directions is a bit strange.
So let me give an example, when I’m running forward and change direction to the opposite way I’m sliding a little distance further before I turn around and go to that direction. I downloaded your script to be 100% sure that there where no mistakes but still the same…

Video of my problem

I’ve played around a bit with Cinemachine and was able to make a reasonably behaved Free Look feature. Clicking the Middle Mouse Button toggles free look on and off. When off, it behaves mostly like the standard camera from the lecture. But when you toggle it on, it allows the player to look around a lot better. I still need to tweak the settings a bit to get rid of the occasional bumpiness but overall it works the way I wanted.

(Edited for spelling)

3 Likes

Increase your angular speed and acceleration. This is what I used.

Snip

In which video of the lecture will there be explained how you can let the player respawn after it died?

I don’t think that the new lectures are there yet.

That looks great! I definitely prefer the way you’re handling camera placement.

my animation seems to have a blending problem, it blends fine to run, but it doesnt blend back down to idle once you reach your destination

edit: figured it out, like a derp, i had the updating animations within the if loop

Hello there,

I have a problem with the knight character floating slightly above the ground. The characters feet are at the height of the navmesh - which is like 0,2 above the real surface.

I can correct this somewhat by setting the Player/NavMesh Agent/Base offset to -0,16 but it’s not an a real solution.
I’m also wondering why it isn’t a problem in the videos…

Thanks for any help with this

Googling around comes up with pages like these :

[https://www.reddit.com/r/Unity3D/comments/6a7bhk/for_those_who_cant_get_their_navmesh_agents_to/]

[https://answers.unity.com/questions/439309/dynamically-fixing-navmeshagent-base-offset.html]

How to control the player speed ?

when holding down mouse left button. the speed is increased continuously until it reaches max speed. and when left mouse is up the speed decreases continuously until the player stops.

on click the player walk not run. and on double click the player run.

You’ll want to adjust the NavMeshAgent’s speed based on these inputs.
Bear in mind that once we get to the combat section, these changes could conflict with our click to attack model of combat.

1 Like

Is there anything you can do for the feeling that the player is sliding around and not running around if i turn 180 degrees?

You could increase the turn speed in the NavMeshAgent.

I was glad we went into late update in this video. I was trying to remember how to fix that problem before we got here, and used FixedUpdate. That was causing major jerkiness and all sorts of weirdness, but I knew that there was issues that could occur within Update. That has been bugging me for a few days now, thanks!

Something I did to make turning around look a little more natural was instead of using the raw z velocity, I got the absolute value. I noticed when you turn around, the z value comes back negative and that’s why you stay in the idle animation for so long. This way you can set the angular speed to whatever you want, mine’s at 750

ezgif.com-gif-maker

2 Likes

I had an issue where there was a large deadzone around the player character where clicks weren’t producing movement. I reduced stopping distance to 0.5 to compensate.

Hello. Im loosing my mind over this animation jittering. Where when u click close to the character he runs snaps into walking all the time. It looks like the value is increasing to maximum speed, alto the target is not that far away. Is there a work around?
ezgif.com-gif-maker(3)

Privacy & Terms