Camera-Relative Movement in Unity 3D Explained

What the heck does all this code mean?! Today we’ll break down every line so that you can move your characters relative to the camera’s rotation in Unity 3D! Learn the basics of Vectors and SPACE and how to transform between the two. Put your programming hat on and let’s get started!
ACCESS PROJECT FILES & SUPPORT THE CHANNEL:
💛 / iheartgamedev
iHeartGameDev Merch:
💛 www.iheartgamedev.com
WANT MORE?
Check out previous videos in this growing series of tutorials:
✅ • Character Controllers
✦ Like the vid? Please consider Subscribing!
bit.ly/2YdIb6j
SOCIAL:
✦ Discord
/ discord
✦ Twitter
/ iheartgamedev
LINKS FROM THE VIDEO:
🤖 Download Jammo for YOUR game:
assetstore.unity.com/packages...
⭐ And Check Out @Mix and Jam !
/ mixandjam
►TIMESTAMPS:
Intro: 0:00
Camera Relative Overview: 0:32
What are Vectors: 1:32
Vector3s Explained: 2:08
Directional Unit Vectors: 2:56
First Code Breakdown: 3:52
Moving GameObjects: 4:47
Coordinate Spaces Explained: 5:34
Moving Gameobjects in Space: 8:58
Second Code Breakdown: 9:50
Rotating Vectors Explained: 10:23
Rotating Vectors Example: 12:00
Moving in World and Local Space: 14:05
Removing Y Value to Stay Grounded: 15:30
Last Recap: 16:55
Final Words: 17:56

Пікірлер: 139

  • @JadonBarnes
    @JadonBarnes Жыл бұрын

    The incredible work that went into visualizing this is awesome. Stuff like this is truly what helps developers like me comprehend the logic of what’s happening. Thanks man!

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Thanks so much, Jadon! The kind words and appreciation for the time that goes into the video mean a lot and make it worth it! Hope it helps!

  • @11sveden12

    @11sveden12

    Жыл бұрын

    @@iHeartGameDev Your hard work paid off. As someone who works in the training space in a different field, this was an excellent way of breaking down a seemingly abstract concept and I'll be adopting some of these methods for visualizing my own trainings I provide. Excellent job!

  • @iHeartGameDev
    @iHeartGameDev Жыл бұрын

    Welcome back to a brand new video! Super excited to finally share this with all of you and I hope this helps you on your gamedev journeys 🍻 One point of clarity that one of the awesome patrons pointed out on the early access video: towards the end of the tutorial, we use InverseTransformVector which is affected by scale. We can alternatively use InverseTransformDirection which is not. Shoutout to vantreeseba for the helpful info! Thank you all for the support and hope to share more with you soon!

  • @Tarodev
    @Tarodev Жыл бұрын

    Heyyyyy, look at that line work! Well done Nicky, amazing stuff. EDIT: Damn. Although this video is about camera-based movement, new devs could come here to get a really solid understanding of vectors. You've outdone yourself on this one.

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Much love for the kindness, my friend! I had to learn all about Vector's and Coordinate Spaces to understand the code we're writing for the camera-based movement. That just tells me that everyone else should too XD

  • @ognisko3292
    @ognisko3292 Жыл бұрын

    You summarized my 3 month study in a 19 minute video. You are awesome !

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Hahaha this is one of my favorite comments I’ve ever received. Thank you for the kind words!

  • @megasoniczxx
    @megasoniczxx Жыл бұрын

    Man, I wish I had this tutorial back when I had started working in unity. It took me a long time to get to grips with how this worked and even now i'm still learning things from this. For instance I never noticed my character slow down without normalizing the vectors on the camera transform and i've heard absolutely no one mention it when going over that part of the process (at least in terms I understood lol) so seeing it broken down and illustrated really helped give me a better understanding.

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Thanks! I hope that you still learned something, or at least reaffirmed what you already know from watching the video! And hopefully it helps some newer devs out :)

  • @nikkan3810
    @nikkan3810 Жыл бұрын

    I followed your character controller tutorials and this issue was a literal abyss, coulnd't have figured it out on my own, finally can continue working on my project :D

  • @alejandroc.c99
    @alejandroc.c99 Жыл бұрын

    i'm going to cry, i've been learning unity for almost 5 years in my free time, trying to get that game realese and never anyone have teach me unity this way!!! :') thank you so much! i feel that game dev heart in each one of your words and explanations. I just want to say THANK YOU. this is the only kind of tutorials that really deserves attention, being that doesn't distracts or take for granted the lines of code! Congratulations and i will be a loyal sub for now on!!!!! 😭😭😭

  • @danfigac8918
    @danfigac8918 Жыл бұрын

    It’s so funny because I went through your other tutorials and I was realizing that it wasn’t exactly what I looking for, and then I found this video and it was like a gift from the gods. Thanks!

  • @andycorah7653
    @andycorah7653 Жыл бұрын

    Amazing work, thanks for taking the time to visualizing this. This will help dev understandings

  • @tx7300
    @tx7300 Жыл бұрын

    this is hands down the best vectors tutorial/explanation ive ever seen

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Thank you!! Hope it helps!!

  • @clafted871
    @clafted8712 ай бұрын

    THANK YOU SO MUCH THIS TOOK ME WAY TOO LONG TO FIGURE OUT 😭

  • @thewightone7441
    @thewightone7441 Жыл бұрын

    Another great in depth tutorial with the same incredible quality you provide. Love it!

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Hey! The Wight One! Thanks for stopping by again 😊 and for the kind words

  • @RadianceCOD
    @RadianceCOD Жыл бұрын

    Such a nice explanation and editing. I don't have words to appreciate this content. Thank you once again 🙏

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Hey Ritansh! I’m glad you liked it! I hope it helps!!

  • @DevNoob
    @DevNoob Жыл бұрын

    Great job and great video editing as always. Very good job!

  • @yairoren5226
    @yairoren5226 Жыл бұрын

    Amazing video! Not only did you provide the code, you also explained in details how it works! Keep it up and thank you so much :)

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Thanks for watching Yair!

  • @DawnosaurDev
    @DawnosaurDev10 ай бұрын

    What a fantastic explanation with great visuals to, thanks!

  • @collin4555
    @collin4555 Жыл бұрын

    Every new overview of applied vector math helps it stick in my head just a little bit better. Thanks for that :)

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Happy to help!

  • @nounonaiyatsu
    @nounonaiyatsu10 ай бұрын

    This video is just incredible, thank you!

  • @severinschmideder1937
    @severinschmideder19374 ай бұрын

    Awesome video once again. I just found your channel and I already learned so much!! So a big Thaaaank youuuu, to you!!

  • @timoteguyot8740
    @timoteguyot8740 Жыл бұрын

    Maybe you've learned something, maybe you don't. But in the end, this kind of content, freely available, is a friendly reminder of how much the internet is incredible.

  • @heman922
    @heman922 Жыл бұрын

    This series is gold ❤️❤️❤️❤️

  • @geminiseDigitalTwin
    @geminiseDigitalTwin Жыл бұрын

    Amazingly detail video. You really are amazing

  • @scarecrow9027
    @scarecrow9027 Жыл бұрын

    This is awesome, this channel is amazing, I've learned so much thanks to you, please keep it up !!

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Thanks so much Scarecrow! Happy to hear that my videos have helped

  • @Michael-ul2dg
    @Michael-ul2dg Жыл бұрын

    Great work! Thank you!

  • @Kvemon
    @Kvemon11 күн бұрын

    Thanks! Nice tutorial

  • @Kncperseus
    @Kncperseus Жыл бұрын

    Hey man, so good to see another video from you

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Thank you KnObi1! :D

  • @aliengarden
    @aliengarden Жыл бұрын

    I'm so hyped for every video from this channel. best unity channel in the world.

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Thank you so much Alde! I really appreciate the kind remark! Hope I can continue to live up to the praise.

  • @BrendanSymington
    @BrendanSymington Жыл бұрын

    Simply brilliant

  • @2etime
    @2etime Жыл бұрын

    It's about time!!!! :) Thanks!

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Thank you for the patience!! Hope it helps!

  • @2etime

    @2etime

    Жыл бұрын

    @@iHeartGameDev Oh. I was talking about someone finally putting out an awesome camera tutorial! Love the detail you give in your videos!

  • @__Rizzler__
    @__Rizzler__6 ай бұрын

    every beginner unity devs has to watch this video

  • @iHeartGameDev

    @iHeartGameDev

    6 ай бұрын

    Agreed!

  • @HiddenExp
    @HiddenExp Жыл бұрын

    Super amazing content man

  • @AlexBlackfrost
    @AlexBlackfrost Жыл бұрын

    Wow, you outdid yourself this time with that editing and visualizations. Keep them coming!

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Much appreciated, my friend! Fun fact: 90% of this video was made in Blender! Thanks as always for watching!

  • @laur429

    @laur429

    Жыл бұрын

    @@iHeartGameDev Wait. which sections of the video are the 90% in question?

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    @@laur429 I’ll never tell!

  • @jaososchefget3632
    @jaososchefget36325 ай бұрын

    writing this so i see it if i ever have to comprehend this again. you're multiplying the z/x of the measured point from wherever you're looking, and multiplying that times the actual axis you're moving on as oriented and measured against the world.

  • @the3rdimension
    @the3rdimension Жыл бұрын

    Just found out your channel whole searching for Animation in Unity. And I loved that series and your other videos as well. Keep making such content. I would like to know that how Inside's player movement works with relative to camera movement🤔 Can u plzz make a tutorial on it?

  • @Kino4
    @Kino4 Жыл бұрын

    Great video, really liked the animations. Just a little remark: if the camera is also rotated around the z axis, the forward and right vectors are no longer perpendicular once you set y to 0. So the resulting input vector will be a bit skewed.

  • @MrOmenMusic
    @MrOmenMusic Жыл бұрын

    Best explanation thanks alot!

  • @sien_auly
    @sien_auly Жыл бұрын

    thank you so much, it helps a lot

  • @HandlebarOrionX
    @HandlebarOrionX Жыл бұрын

    This did a good job of explaining C#! I had to join the discord

  • @louptreize
    @louptreize Жыл бұрын

    You blow my mind ! 💟

  • @darkeinhardt3760
    @darkeinhardt3760 Жыл бұрын

    awesome work

  • @emeraldbreak1165
    @emeraldbreak1165 Жыл бұрын

    Great vidéo for sure, thanks a lot ! But i tried to emplement the code in my game and can't figure how to do it... is the script have to be in the camera or the character ? and does this code allow the character to move when we press the arrow / WASD keys ?

  • @Shadowjones
    @Shadowjones Жыл бұрын

    Dude. Literally just spent 4 days setting up a player controller with a free look camera pretty much from scratch for this exact result. Was looking for a Smite style cam if you're familiar with the game...

  • @widearchshark3981
    @widearchshark3981 Жыл бұрын

    Brilliant explanation, although I'll have to watch this a few times!

  • @pixelshenanigans1511
    @pixelshenanigans1511 Жыл бұрын

    Great explanation!

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Thank you Mark! Hope it helps! :)

  • @alexsepph
    @alexsepph Жыл бұрын

    My English is bad, but I learned more from this video than from my native language videos. Incredible.

  • @Mikelica69
    @Mikelica69 Жыл бұрын

    Omg!! Tysm 💜💜💜

  • @dwried
    @dwried Жыл бұрын

    I used this logic in a game where I add a physics force to a ball in a game that's constantly rotating, but didn't want the camera to alter the movement of the ball. I got the forward and right of the camera, and had the camera point to an empty object attached to the ball(the empty object tracked the position, but not rotation of the ball). Then I used the empty object info. to apply force to the ball. Used cinemachine to deal with the camera rotation around the ball (actually it was pointed at the empty game object, so i could move it a bit as I wanted to offset the camera target angle). This way I could use w,a,s,d for movement and mouse for camera movement. Not sure if it was the best way to deal with it, but it worked pretty good. This video helped a ton.

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Fantastic explanation! Thank you for sharing Darin!!

  • @dwried

    @dwried

    Жыл бұрын

    @@iHeartGameDev Thanks. I've been trying to learn ways to reuse code and during this I was able to move the script that I had on the camera to the empty object for tracking an object, but not the rotation.

  • @ShadzMadz
    @ShadzMadz Жыл бұрын

    Actually solved alot of my problems and dumbed it down to my level of understanding, really amazing work, this is quite literally the only roadblock i've ran into while making my game. Now I do have 2 questions, 1: does this work with cine Machine? and 2:Does this work with the new Input system?

  • @AXISMotionStudio
    @AXISMotionStudio Жыл бұрын

    Which VS Code theme are you using

  • @TunaynaGab
    @TunaynaGab4 ай бұрын

    Hello! Thank you for the video! Really great content, was able to implement changes i needed I wanted to ask about movement code. My computation handling of adding velocity or rotating is all in the update function. I feel like it would be better if there are individual functions for it to make it easier to read (maybe even better performance since it doesnt really run every computation at every frame). Although im scratching at my head on deciding where to start or how Please let me know what you think would be best

  • @youknownuno
    @youknownuno Жыл бұрын

    Top Notch presentation and tutorial, I've shared this with my team

  • @ItsChaosUnicorn
    @ItsChaosUnicorn Жыл бұрын

    DUDE, how the heck are these videos made? After Effects? The animations are so precise! whats......

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    I made this one 90% in Blender

  • @dahstroyer
    @dahstroyer Жыл бұрын

    Yo I made it on the video! Best tutorial I've seen hands down.

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    :D heck yea! Thanks Dahstroyer!

  • @tintimesftw4978
    @tintimesftw49783 ай бұрын

    If Im doing it now, Im sure someone else is: if you watched his state machine video, you just gotta apply the code to the walking state/running state, and alter it a bit; you won't need the "playerVerticalInput" / "playerHorizontalInput" since your statemachine should already have those values with the input machine, forwardRelative input variables will need Ctx.CurrentMovementInput.x and .y respectively instead, and Ctx.appliedMovement will have to = cameraRealtiveMovement * your speed value.

  • @tintimesftw4978

    @tintimesftw4978

    3 ай бұрын

    Oh and I didnt make it a seperate function I just put it in the UpdateState function... Im sure theres a better way or something but its working for me so meh also be sure to zero out the y functions or your character will fly in 3d space.

  • @patrikzub8499
    @patrikzub84992 ай бұрын

    Hi! Works great for camera controlls but may I ask why does it decrease the gravity effect? the character falls incredibely slow and idk why, but by removing this code gravity works well. Any tips? thank you!

  • @lanefaulhaber875
    @lanefaulhaber8759 ай бұрын

    Where do we put this in the code from the previous videos in the series? I wrote the function in the body of the PlayerStateMachine. Do I just call the function in update() after doing that? When I run the code with the MovePlayerRelativeToCamera() function in the update, my character speeds forward and the camera does not adjust to his movement. Any help would be appreciated!

  • @iHeartGameDev

    @iHeartGameDev

    9 ай бұрын

    Hey! There’s a separate video explaining that right after this! Check the channels list of videos

  • @lanefaulhaber875

    @lanefaulhaber875

    9 ай бұрын

    @@iHeartGameDev Great, I'll check that out! thank you so much for the reply!

  • @friendlydude6485
    @friendlydude6485 Жыл бұрын

    so how do i make my movement corespond to direction that my camera is facing so that pressing w moves me foward even tho it applyesforce in the oppasite dirrection or do i have to scrap my movement sorry for bad english

  • @jisan4464
    @jisan44645 ай бұрын

    fantastic 🎉🎉🎉

  • @iHeartGameDev

    @iHeartGameDev

    5 ай бұрын

    Thank you so much!

  • @MarekNijaki
    @MarekNijaki Жыл бұрын

    Awesome video

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Thanks for watching Marek!

  • @Ericsogm
    @Ericsogm Жыл бұрын

    id love to see this with the new input system, having issues figuring it out

  • @Soulsphere001
    @Soulsphere001 Жыл бұрын

    I never thought about, or maybe I keep forgetting, that you can think of this as coordinate space conversion. It does sometimes help to see it as a change in coordinate space, though you usually care more about the local change until you convert to world space or whatever other space you're converting to. I find it really odd that you can sort of rotate in that way. But then, I guess, that's probably how matrix math works. I gotta train my brain to think in terms or changing coordinate spaces rather than translations and rotations of a single object. EDIT: In the same way it's pretty obvious that the world revolves around the camera, but it's difficult to see in those terms since we are conditioned to see things in world space. EDIT 2: Unfortunately this wasn't what I was looking for, but it's interesting and something to think about.

  • @Nebula_Protogen752
    @Nebula_Protogen752 Жыл бұрын

    how can I get camera relative movement using the new input system? Fantastic video BTW!

  • @arpan9133
    @arpan9133 Жыл бұрын

    Which video editor do you use?

  • @praisefrancis6257
    @praisefrancis6257 Жыл бұрын

    hello am not sure if this has happene to someone but my unity editor keeps telling me that am using the new input system not the input package which am confuse dhow you did it pls can you help me

  • @siavashaliyari8567
    @siavashaliyari8567 Жыл бұрын

    I used the project method to project my cameras directions on to a plane that its normal is the players up wards vector, idk if that way is better or worse, nice vid

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    I’d love to learn more about this method. Is there any resources you have to share where I can learn more?

  • @siavashaliyari8567

    @siavashaliyari8567

    Жыл бұрын

    @@iHeartGameDev Vector3 forwardDirection=Vector3.ProjectOnPlane(Camera.main.transform.forward,ctx.gameObject.transform.up); Vector3 rightDirection = Vector3.ProjectOnPlane(Camera.main.transform.right, ctx.gameObject.transform.up); this is how I get the directions which I don't think makes any difference, and the (ctx.gameObject) is the player, I used your state machine :3

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    @@siavashaliyari8567 Super interesting! I've never seen ProjectOnPlane before. I'll have to play around with it! Thank you for sharing Siavash!

  • @ThePiprian
    @ThePiprian Жыл бұрын

    How do I actually implement this? I added this code to the movement code from the earlier tutorials (with the new movement system), called it in void update, and it does seemingly nothing. Do I have to multiply my movement with "cameraRelativeMovement" somewhere?

  • @Chukilled
    @ChukilledАй бұрын

    The only thing I would add to this code is literally the last line public float speed; this.transform.Translate (CameraVariable * speed * Time.deltaTime) Cause my character was zinging all over the world!

  • @DPD232

    @DPD232

    16 күн бұрын

    Hi! My character is also zinging, could you explain a bit in detail what led you to this solution? :3

  • @hakanviajando
    @hakanviajando Жыл бұрын

    Great video, one movement method you forget is to keep the player always on Vector3.zero, and then moving and rotation the whole world around it.

  • @femboyfootfetish86
    @femboyfootfetish86 Жыл бұрын

    Could your make a tutorial about behavior trees pls

  • @sutixela
    @sutixela Жыл бұрын

    How do you change speed?

  • @smbiplob9476
    @smbiplob94763 ай бұрын

    This tutorial is awesome. You are gonna replace "brackeys" youtube channel.

  • @iHeartGameDev

    @iHeartGameDev

    3 ай бұрын

    Thanks for the kind words!

  • @dexlambon2235
    @dexlambon22358 ай бұрын

    I'm confused. How to connect this to a speed variable also forward and backwards movement isn't working.

  • @weckar
    @weckar Жыл бұрын

    One thing I have had trouble with in the past applying this method, is that if you have the camera following the player it can lead to highly unwanted behavior - for instance, rapid spinning in place of the character. Otherwise, do appreciate the logic breakdown at the start. Allows those who understand the math get straight to the point.

  • @protophase

    @protophase

    5 ай бұрын

    How do you fix this?

  • @hydroweapon
    @hydroweapon Жыл бұрын

    Think i'll need to watch a few more times

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    That’s like me with Freya’s video 😂 A LOT to take in here in a short amount of time

  • @hydroweapon

    @hydroweapon

    Жыл бұрын

    @@iHeartGameDev XD Loving the content man, always high quality stuff

  • @parziwal57
    @parziwal57 Жыл бұрын

    i just want to ask, where should I write this code to connect with jammo

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    stay tuned! New video really soon showing how to!

  • @user-wc1vi9qb6v
    @user-wc1vi9qb6v6 ай бұрын

    Hi, how to calculate distance traveled from camera movement ?!!

  • @anonymoussloth6687
    @anonymoussloth6687 Жыл бұрын

    Will you be covering cinemachine?

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Next video will break down Cinemachine's Free Look Camera!

  • @ElUltimoNacho
    @ElUltimoNacho Жыл бұрын

    i followed your character controller tutorial, but when i do this I can't apply the gravity. ¿What can i do?

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Awesome! Thanks for watching! My next video will show you how to do it!!

  • @prudentibus
    @prudentibus10 ай бұрын

    I came looking for copper and i found gold

  • @Ricky9871973
    @Ricky9871973 Жыл бұрын

    How would this be implemented in the current state machine system?

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Coming after the next video’

  • @gamescrash6281
    @gamescrash628111 ай бұрын

    Nice video, works fine for me, but the only issue, is my person wont turn to the foward direction :(

  • @tomdriver6733
    @tomdriver673311 ай бұрын

    My Character runs in a Circle, when moving sideways. What could be the Problem? It should go in a straight Line.

  • @RinzyOtt
    @RinzyOtt Жыл бұрын

    Your tutorials have been a huge help, and I'm amazed this came out literally the day before I needed it hahah I'm having a bit of an issue though. I'm trying to get this to work with a character controller and the new input system, but I'm getting an issue where moving the camera after the character has started moving doesn't change the character's direction. I can, however, stop moving, reposition the camera, and the character will move relative to that new position. Any ideas what might be going on?

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    Hey! It sounds like values of the camera forward and right vectors aren’t updating for some reason if you’re moving - or they aren’t being used in your movement code at that point. Definitely worth investigating the vector values being passed to your movement method

  • @RinzyOtt

    @RinzyOtt

    Жыл бұрын

    @@iHeartGameDev I kind of had to shove the code into the onMovementInput method, otherwise it just won't respond at all. Right now, this is what I have there: //get player input values currentMovementInput = context.ReadValue(); //get camera-normalized directional vectors Vector3 forward = cam.transform.forward; Vector3 right = cam.transform.right; forward.y = 0; right.y = 0; forward = forward.normalized; right = right.normalized; //create direction-relative input vectors Vector3 forwardRelativeVerticalInput = currentMovementInput.y * forward; Vector3 rightRelativeVerticalInput = currentMovementInput.x * right; //create camera-relative movement Vector3 cameraRelativeMovement = forwardRelativeVerticalInput + rightRelativeVerticalInput; //Apply relative movement to current movement direction. currentMovement.x = cameraRelativeMovement.x; currentMovement.z = cameraRelativeMovement.z; currentRunMovement.x = cameraRelativeMovement.x * runMultiplier; currentRunMovement.z = cameraRelativeMovement.z * runMultiplier; isMovementPressed = currentMovementInput.x != 0 || currentMovementInput.y != 0; And I just can't figure out how to go from there. Separating them into separate methods just causes the local cameraRelativeMovement to be unusable in onMovementInput. Declaring cameraRelativeMovement in the class and then defining it in the method also breaks it. It just REALLY doesn't want to be anywhere but onMovementInput.

  • @iHeartGameDev

    @iHeartGameDev

    Жыл бұрын

    @@RinzyOtt is this character controller based on my character controller series?

  • @RinzyOtt

    @RinzyOtt

    Жыл бұрын

    @@iHeartGameDev Yes! Sorry, I should have mentioned that hahah

  • @bunzy5279

    @bunzy5279

    Жыл бұрын

    @@RinzyOtt You figure it out? I've tried alot of solutions and nothing works, with the new input system as far as I know.

  • @nonamenofame2243
    @nonamenofame2243 Жыл бұрын

    can anyobdy send the final script ?

  • @jldldr3933
    @jldldr393311 ай бұрын

    But what if the player comes too close to the camera?

  • @RadianceCOD
    @RadianceCOD Жыл бұрын

    Waiting...

  • @praisefrancis6257
    @praisefrancis6257 Жыл бұрын

    Hi

  • @joystickstudios6580
    @joystickstudios6580 Жыл бұрын

    Incredible video . But the background music 🎶🎶 is annoying

  • @axelmonogatari3175
    @axelmonogatari31754 ай бұрын

    head blown

  • @ZOMGbies
    @ZOMGbies Жыл бұрын

    Did you really go through ALL OF THAT and not include rotation?

  • @fercon9892
    @fercon98925 ай бұрын

    code has 31 errors.

  • @Nyclia_Mycandra
    @Nyclia_Mycandra2 ай бұрын

    Meow