Open World Tutorial Series - Creating the Movement Code
HTML-код
- Опубликовано: 25 апр 2019
- Join our Filmstorm Motion Library: / filmstorm
In this first lesson, we setup a completely code driven movement system which handles gravity, input turn rotation relative to the forward camera direction.
#unity #openworld #filmstorm
Download the resource and project files here: filmstorm.net/blogs/tutorials...
This is the best way to drive a third person character with simplicity and code efficiency and is also supported in the latest Unity 2019 build.
We will be creating a fully open world game from scratch as requested by many viewers.
---------------------------------------------------------------------------------------------------------
Our latest products from Gumroad are:
GTA Animation Pack and Tutorial: gum.co/gtapack
Sword Hack & Slash Animation Pack: gum.co/ninjas
Assassin's Creed Climbing System - Unity3D (BETA): gum.co/acclimb
------------------------------------------------------------------------------------------------------
Thanks for checking out my tutorials, I really appreciate it. If you want to take your Filmstorm experience to the MAX, check out www.filmstorm.net for more free assets and project downloads today!
Current Projects:
GTA Single Player System: • Single Player GTA Unit...
FPS System: • FPS in Playmaker Game ...
3rd Person Character Movement: • Third Person System Tu...
2.5D Player System: • 2.5D Character System ...
-----------------------------------------------------------------------------------------------------------
Have more suggestions for content? Leave a comment below and let me know what you want to see. Кино
i was struggling to make my character face the direction he moved in rather than reverting back to his original direction. I'm so glad i found this, probably the best tutorial out there..clear explanations and examples to follow. I can't wait to see the rest of the series, keep up the good work! :)
I'm looking forward to see next partsss!! 🤯🍻
Still waiting :(
Brilliant! Was looking forward to this.
Great tutorial!
I'm looking forward to the next episode
Great tutorial! Can't wait to watch the rest. Thanks!
I figured out my issue. Thanks for these amazing videos! Very Informative and goes into detail about how it all works together keep up the good work
Really happy seeing a video from you
Little late to watch, but one of the best tutorials for 3d character movement I have personally seen thank you so much!
Im a pro développer of Unity because of you and others youtuber its Been 3 year and i will forever support you're Channel , i missed the Time when i was a noob and i Always looked at ur Channel.
Good continuation
Thanks Veraliot, I really appreciate you taking the time to write this comment :D
@@Filmstorm You're welcome i wish you a good road on this life ^^
That's what i need. Waiting new videos..
I really hope to this project keep going. I combined this and another tutorial to make a movement system that really works for my project, I can't wait to learn more.
What was the other tutorial you found? I've been looking for days trying to figure out how to get the character to move straight horizontally in relation to the camera when I press "a" or "d" instead of having him run in circles around the camera.
@@DRYstudios1994 oh sorry, the other tutorial was for flight, I cant help there
Damn, how am i just finding this now?! cant wait to see whats next
looking forward also for this sir
Exactly what I wanted
devastated that you didnt continue this series
please bro we needed this tutorial
kind of a shame there's no second episode to this series, but thanks a lot for your help!
Glad to see you back
Please make tutorial on how to make car Enter and Exit system with animations
@Filmstorm hi thanks for the tutorial i did everything to the tee and its works exactly how you intended, 2 questions is this still one of the best ways to have a camera setup? and if you could tell me shortly what path i should take to animate this, does it require more code?or do i simply make my own animations and set them up with unity its self?
Are you gonna add add a character with animation in the future in this controller?
The movement code isn't the hardest part.
Unity is lack of a proper solution system for managing large terrain. I hope I can learn something from this tutorial series.
Thank's aloooooooooooooooooot
Hi !
Thank for your tutorial, it works great !
I have a questions for you if you don't mind
When I go left and hold, the camera doesn't follow the target "horizontally", it makes a slow rotation which changes the initial target destination of the left input after a while. How to make it sticks completely to the character movement?
Thanks again and have a good day !
Nice video, but only one video yet? (In this Tutorial Series)
Add it to a playlist if not already added it would be helpful . Thank you cheers
Yes we will add it to the Playlist. 👍🏼
Tnx
When will the next tutorial/episode come out?
Will you add a cover system in this project?
thank you for the tutorial. my only issue is the cinemachine didn't go to the top like shown :')
Still Waiting for more parts.....
👍👍👍
Hi, how do i add jump function to this? please reply, thanks!
This is good stilll, but we wanna see more playmaker tutorialssss
Will this series continue? :'(
How do you get the scene lighting like you have it (with a global light and no shadows, etc). My default scene lighting looks nothing like yours. thanks!
Open Window (at top of unity) > Rendering > Lighting Settings
it will open a window , in Environment lighting Section Change The Source , From SkyBox To color or gradient
character controller
When I put my character, my character's own collider is disabled. How do I fix this? Thanks!
So, what I'm having a problem with is that the character is moving faster when moving diagonally. I tried figuring out where to normalize it (if that is possible), but couldn't figure it out.
What if I don't want the capsule to follow the rotation of the camera?
Great video but hard to watch on a 1080p display..
True, should make the text larger?
@@Filmstorm that would help a lot :)
I can't access the project files on the website. I get a 404 error when i open the link.
You some very interesting videos on your channel the only downside is that you don't upload videos regularly !
Resource and project files is now not availible? I get a 404 error when I try to follow a link.
Hey let me look into it and I’ll get a new link online for you
The link inthe discription doesnt work anymore
Where are the other parts?? 🤔
hey can you please update the Open World Animations please, for example, add interaction animations, or something else. Because the Open World Animations are the same price as the adventure kit, and it is much better I just didn't know about it when I bought the Open World.
Could you Show how to add a Charakter?
Coming up in the new tutorials!
excuse me...!!!! your resource file not exist, if i like follow you, how i work if you don't have the resource file ?
Where's the next tutorial :..D
Oh my, it is time for a new one isn’t it. 🚀
so many good videos by unity2019 HDRP,but open games(hdrp) less less less'''''''''
We are covering the HDRP setup and implementation in the next couple of tutorials 👍🏼
Why is my character moving so fast Plz help
After seeing this I watched it like 20 times after and never noticed that 2nd bit on gravity you put in well turning it to gravity Multiplayer you put something in that I can't see. I then went on my own taking a note from one of your other tuts and added a animator witch worked quite well but then instead of waiting I tried to figure out jump asked some friends and it just kinda boiled down to breaking the code and all the gravity so back to square one and maybe just wait for the jump video....
To be kinda clear at 26:32 I'm guessing the Private Float with the InputX, Input Z and Speed is where you put a Gravity call.
14:40 and this is all I see
NullReferenceException: Object reference not set to an instance of an object
MovementController.MovementManager () (at Assets/Scripts/MovementController.cs:32)
MovementController.Update () (at Assets/Scripts/MovementController.cs:24)
17:56
NullReferenceException: Object reference not set to an instance of an object
MovementController.MovementManager () (at Assets/Scripts/MovementController.cs:47)
MovementController.InputDecider () (at Assets/Scripts/MovementController.cs:40)
MovementController.Update () (at Assets/Scripts/MovementController.cs:29)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(CharacterController))]
public class MovmentsController : MonoBehaviour
{
private float InputX, InputY, Speed;
private Camera cam;
private CharacterController characterController;
private Vector3 desiredMoveDirection;
[SerializeField] float rotationSpeed = 0.3f;
[SerializeField] float allowRotation = 0.1f;
[SerializeField] float movmentsSpeed = 1f;
[SerializeField] float gravity;
// Start is called before the first frame update
void Start()
{
characterController = GetComponent();
cam = Camera.main;
}
// Update is called once per frame
void Update()
{
InputX = Input.GetAxis("Horizontal");
InputY = Input.GetAxis("Vertical");
MovmentsManager();
InputDecider();
}
void InputDecider(){
Speed = new Vector2(InputX, InputY).sqrMagnitude;
if(Speed > allowRotation){
RotationManager();
}
else{
desiredMoveDirection = Vector3.zero;
}
}
void RotationManager(){
var forward = cam.transform.forward;
var right = cam.transform.right;
forward.y = 0;
right.y = 0;
forward.Normalize();
right.Normalize();
desiredMoveDirection = forward * InputY + right * InputX;
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(desiredMoveDirection), rotationSpeed);
}
void MovmentsManager(){
gravity -= 9.8f * Time.deltaTime;
Vector3 moveDirection = desiredMoveDirection * (movmentsSpeed * Time.deltaTime);
moveDirection = new Vector3 (moveDirection.x, gravity, moveDirection.z);
characterController.Move(moveDirection);
if(characterController.isGrounded)
{
gravity = 0f;
}
}
}
wen sprint and jump? 😂
hiiiiiiiii
What's with the video quality?! Am I only one getting only 360p or?
Still processing! Hope it’s done soon 👍🏼
I would like to use this without CharacterController ... :/
Would you rather move the character with physics instead? I can write a custom piece of code for you to get it working 👍🏼
@@Filmstorm Exactly, I'm trying to make a Hack and slash, I really like your tutorials but I always want to change something hahaha, if you can help I'll be grateful !!
No problems, give me a bit and I’ll get something back to you.
Thank you very much, I'll be waiting !!
@@roundzerodev did you get a response?
Could you tell me the pc requirements for unity or ue4
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(CharacterController))]
public class PlayerMovment : MonoBehaviour
{
private float InputX;
private float InputZ;
private float Speed;
private Camera cam;
private CharacterController characterController;
private Vector3 MoveDiracsion;
[SerializeField] float rotationSpeed = 0.0003f;
[SerializeField] float alloRotasion = 0.0001f;
[SerializeField] float MovmentSpeed = 0.0001f;
// Start is called before the first frame update
void Start()
{
characterController = GetComponent();
cam = Camera.main;
}
// Update is called once per frame
void Update()
{
InputX = Input.GetAxis("Horizontal");
InputZ = Input.GetAxis("Vertical");
InputDecider();
MovementManeger();
}
void InputDecider(){
Speed = new Vector2(InputX, InputZ).sqrMagnitude;
if(Speed > alloRotasion){
RotationManeger();
}else{
MoveDiracsion = Vector3.zero;
}
}
void RotationManeger(){
InputX = Input.GetAxis("Horizontal");
InputZ = Input.GetAxis("Vertical");
var camForward = cam.transform.forward;
var camRight = cam.transform.right;
camForward.y = 0;
camRight.y = 0;
camForward.Normalize();
camRight.Normalize();
MoveDiracsion = camForward * InputZ + camRight * InputX;
transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(MoveDiracsion), rotationSpeed * Time.deltaTime );
}
void MovementManeger(){
Vector3 DesierdMoveDiracsion = MoveDiracsion * Time.deltaTime;
characterController.Move(MoveDiracsion);
}
}
why is my character moving so fast plz someone help