Тёмный
No video :(

First Person Controller - Using Doors (EP12) [Unity Tutorial] 

Comp-3 Interactive
Подписаться 16 тыс.
Просмотров 17 тыс.
50% 1

Опубликовано:

 

5 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 109   
@roguetaver579
@roguetaver579 2 года назад
I wish this series comes back, it's been awesome! Thanks a lot :D
@voodoolew
@voodoolew 8 месяцев назад
I really do hope you come back to this series one day. Your FPS controller is genuinely one of the best I've found. It'd be awesome to see this go on to more mechanics like an inventory system, further interactions, triggers, dialogue scenes, cut scenes and more base line mechanics that you see in games. Rewind or Die was awesome by the way, and I have End Of The Line wishlisted! All the best
@coolgamerguy436
@coolgamerguy436 Год назад
If you are facing the issue of the door opening correctly one way but not the other, it could be because the door's front and back are on the x-axis. In the door script, for the doorTransformDirection, instead of Vector3.forward, use Vector3.right. Or simply change your door's front and back to the z axis
@dremovremen1764
@dremovremen1764 Год назад
Didn't work for me (my issue is the door opens only one way). Also, if I've done everything just like Mike, why we've got different results?
@coolgamerguy436
@coolgamerguy436 Год назад
@@dremovremen1764 is the door's front and back on the z axis?
@dremovremen1764
@dremovremen1764 Год назад
@@coolgamerguy436 I've already managed to fix this by simply selecting experimental apply transform in blender export. I forgot that I already had the same issue, and that was the same solution.
@GogoGames07
@GogoGames07 8 месяцев назад
maaaaan you saved meeeee
@geocker4158
@geocker4158 7 месяцев назад
Thank You man, you saved me
@Jim_the_Hermit
@Jim_the_Hermit 11 месяцев назад
Please continue this series. (Shooting? Gun system?) You're one of the few coders that can actually teach.
@kelvoid3023
@kelvoid3023 2 года назад
Great tutorial series! Love building upon earlier systems. A tip for folks reading this, since it came up in the video, the default hot keys for toggling the transform tool handles position between pivot/center and local/world are 'Z' and 'X' respectively.
@JermsKylefilms
@JermsKylefilms 11 месяцев назад
this has been some of the best tutorials ive ever follow... props
@El-Iks
@El-Iks Год назад
I've learned an insane amount of things through this tutorial series. Thanks
@alexshepler403
@alexshepler403 2 года назад
You've helped out a ton. I love the series. Are you going to make more videos?? If you do, could you please do one with adding a player model, and potentially objects, like either a gun or throwables that the player can use.
@zurkio6179
@zurkio6179 2 года назад
Can you read my mind?! I was literally thinking about how to do that 2 hours ago! Best man!
@keremikzz6509
@keremikzz6509 2 года назад
i generally do it with animations and trigger boxes and i prevent bugs with the animation opening and closing by itself but i think this tutorial is much more practical and optimised
@LalliPallero
@LalliPallero 2 года назад
This series has been great, thanks a lot! Only one thing missing from this series is picking up objects and throwing them around with the interaction system in place. I can't seem to make it work smoothly
@Heperoo
@Heperoo Год назад
For some reason my door only opens one way (only plays the OpenOut and CloseFromOut animations). And when i change the dot parameters in animator (from ClosedIdle to OpenIn to less 0, and from ClosedIdle to OpenOut to greater 0) it will play the other way around, so it will only play the OpenIn and CloseFromIn. Do you know any fix to that?
@MarsLaaars
@MarsLaaars Год назад
@@Heperoo I got the same problem 😅. Did you find a solution?
@Heperoo
@Heperoo Год назад
@@MarsLaaars no I haven't lmao
@MarsLaaars
@MarsLaaars Год назад
@@Heperoo ahh shii 😝
@Heperoo
@Heperoo Год назад
@@MarsLaaars Well, if you find the solution, feel free to tell lmao
@monkeyrobotsinc.9875
@monkeyrobotsinc.9875 Год назад
17:41 HAHAHHA i love all the humor in this one. EDIT: now im thinking maybe you meant opening from this side or opening from the other? haha
@sherkich_de_chort
@sherkich_de_chort Год назад
I hope these lessons continue. They are really cool and I would like more. I would like to see a lesson on dash.
@cupcake6086
@cupcake6086 2 года назад
youre the best , a little suggestion ( when the player is crouched he still can jump , so u could disable can jump if the player is crouched . Or when the player is crouched and jump he directly stand and jump but the time to do it will be higher than if he is standing,) thanks a lot for those tutorials :D
@defiantparsnip
@defiantparsnip 2 года назад
In HandleJump on the FirstPersonController, add " && !isCrouching" to the if statement with ShouldJump. Then it will only jump if the player is not crouching and should jump.
@0NEFREEMAN
@0NEFREEMAN Год назад
I would love to see you continue and expand on these videos if you ever get the time. Regardless, thanks for the great tutorials and hope you're doing well!
@marcus_vdm
@marcus_vdm Год назад
Absolutely fantastic!! Just finished the entire series and have an awesome playercontroller now! You should make a climbing tutorial next to expand on this! Great job!!
@SeaFoamStrat
@SeaFoamStrat 2 года назад
Yess, been waiting for this! Thank you so much for the tutorials!
@zendraw3468
@zendraw3468 Год назад
hey man, are you going to come back to these series?
@Hypn0ninjaGaming
@Hypn0ninjaGaming 2 года назад
Absolutely awesome tutorial series, thank you so much. Well explained, well paced and i'm learning so much. Looking forward to the next video :)
@Marco37472
@Marco37472 Год назад
Loving this series so far! Please please cover creating an animation controller and maybe even adding an FPS element to it.
@LM-cc7qz
@LM-cc7qz 2 года назад
For those of you who can only get the door to open correctly one way and have to click and an angle for the other direction you need to make sure that the 2 sides of the door are aligned on the Z axis because that is the axis we are checking using the dot product.
@vaqquixx8620
@vaqquixx8620 2 года назад
Adding on to this, to have your door face in any direction, put into an empty GameObject, I called mine "DoorHolder" and rotate that object instead of the actual door.
@Heperoo
@Heperoo Год назад
@@vaqquixx8620 For some reason my door only opens one way (only plays the OpenOut and CloseFromOut animations). And when i change the dot parameters in animator (from ClosedIdle to OpenIn to less 0, and from ClosedIdle to OpenOut to greater 0) it will play the other way around, so it will only play the OpenIn and CloseFromIn. Do you know any fix to that?
@Heperoo
@Heperoo Год назад
For some reason my door only opens one way (only plays the OpenOut and CloseFromOut animations). And when i change the dot parameters in animator (from ClosedIdle to OpenIn to less 0, and from ClosedIdle to OpenOut to greater 0) it will play the other way around, so it will only play the OpenIn and CloseFromIn. Do you know any fix to that?
@commandergt-ey7vl
@commandergt-ey7vl 3 месяца назад
Hey, I really love your tutorials! But I have a few questions. | 1. Would this work in a horror game? | 2. Could you possibly make an animation tutorial so we can have a player model? | 3. Could you possibly make a tools tutorial? | Your tutorials are awesome and keep up the good work!
@SeanGauseOfficial
@SeanGauseOfficial 3 месяца назад
why would this not work in a horror game?
@cliptimechaos6920
@cliptimechaos6920 Год назад
I know I m a bit late but you are the only one that can help me now. I m stuck for days now trying to make the character stay on a moving object. I m trying to make a zeppelin that you will control in the game but I can't even get the character to stay on moving cube. I hope you read this and maybe give me an answer. And btw it's the 3 time I m watching your tutorial series it's just to good :)
@Krwatkins0002
@Krwatkins0002 Год назад
The usual trick is to have your character become a child game object of the platform or in your case the zeppelin. There are a lot of resources about this subject so I won't go into too much detail, use a raycast or a trigger area to detect the platform and parent/unparent accordingly.
@cliptimechaos6920
@cliptimechaos6920 Год назад
@@Krwatkins0002 thanks for the responds, but the problem is I already did that and the character becomes a child but when I move it in the scene myself the character will not stay on there for long and doesn't move the same distance as the platform. And if I add force to the platform through code the player will just stay and the platform slide under him away
@Krwatkins0002
@Krwatkins0002 Год назад
@@cliptimechaos6920 Oof sorry, yeah it seems whenever CharacterController.Move() is called it'll cancel out any movement of a parent game objects transform. Looking like you'll have to match the direction and speed of the platform to the player whenever you detect a player on one. I'm not there yet myself in my prototype and I'm used to using rigid bodies when I figure something out I'll try to remember and post it here. Don't hold your breath tho, I get sidetracked like no other!
@cliptimechaos6920
@cliptimechaos6920 Год назад
@@Krwatkins0002 no problem man. At least you showed me the problem. Thanks :)
@cliptimechaos6920
@cliptimechaos6920 Год назад
@@Krwatkins0002 Hi man. Was just here checking out if you found6a solution to the problem we both/ I asked you, have?
@laoyu8983
@laoyu8983 6 месяцев назад
Please continue with the tutorial on swimming and climbing ladders, okay?
@DragonPox90210
@DragonPox90210 2 года назад
These videos are a godsend! I'm actually learning stuff- is there the possibility of adding swimming or climbing up small ledges in the future?
@HasanAbaza_
@HasanAbaza_ 2 года назад
I have a issue The Animation Always play openin
@MarsLaaars
@MarsLaaars Год назад
same
@skaruts
@skaruts 2 года назад
Do you also make the maps in Blender? I'd love it if you could make a video about the workflow you use, and whatever tip & tricks you might have up your sleeve. I'm tempted to try using TrenchBroom, because I can never get along with Blender for map making (because of texturing complications). But maybe Blender is fine and I'm just missing something, I dunno.
@swevygaming5909
@swevygaming5909 8 месяцев назад
This was actually so helpful, thank you so much for your effort on this!
@bitsentinal1993
@bitsentinal1993 Год назад
where can i learn to animate character controller while using your code
@MrRiceKrispyNotTaken
@MrRiceKrispyNotTaken Год назад
hey man, i'm wondering if there's gonna be a continuation of these tutorials
@TehJenness
@TehJenness 2 года назад
I'd love to see Hunger/thirst/insert other 'need' here tutorial as it's something I've been trying to get right to this series. ^^;
@alexanderdejanovic7585
@alexanderdejanovic7585 2 года назад
Absolute banger of a series my man
@andrewfrolov5144
@andrewfrolov5144 Год назад
Please do not stop!
@Bob-ts2tu
@Bob-ts2tu Год назад
I've just finished and have to say i really enjoyed the learning experience as well as getting a FPC i fully understand & can customise and use. I'm going to add things like an option screen message like 'Press to open door' when interaction becomes available, optional auto-close door, enums for options like tags and layers, optional crosshair or dot in the centre of the screen, and a few other things, so once again thanks
@CRUMVIII
@CRUMVIII 2 года назад
Thanks for this. Just like you said, been doing them wrong for ages.
@hermannlagrange803
@hermannlagrange803 2 года назад
Super duper useful series man, kudos! If you haven't done it yet, or haven't thought of doing it, could you maybe do a series or a single video on finite state machines? They seem super useful and scalable, which was the point of this series as well, to make the script scalable.
@josefvlcek3510
@josefvlcek3510 2 года назад
Excellent series!! Thank you so much. Proposal for next time: Pause menu. please keep doing what you're doing. Thank you.
@kiwiko4830
@kiwiko4830 2 года назад
Could you also do videos on UIs such as main menu screens, pause menu screens, inventory, etc. That would be amazing. Keep up the good work! Hope to see this series come back!
@Heperoo
@Heperoo Год назад
For some reason my door only opens one way (only plays the OpenOut and CloseFromOut animations). And when i change the dot parameters in animator (from ClosedIdle to OpenIn to less 0, and from ClosedIdle to OpenOut to greater 0) it will play the other way around, so it will only play the OpenIn and CloseFromIn. Do you know any fix to that?
@DanPos
@DanPos 2 года назад
Excellent video mate!
@mlgjman1837
@mlgjman1837 2 года назад
Thanks for the series
@TrinityFlash
@TrinityFlash 2 года назад
Great tutorial series! Will you ever be doing any tutorials on setting up animations for the character?
@JustJoshinYouBro
@JustJoshinYouBro 9 месяцев назад
Can i implement this script with any type of door say a cabinet, and a door, and a chest in my project?
@torstaken
@torstaken 2 года назад
Can you make a tutorial first person legs or ledge climbing please? Btw I love these tutorials.
@deadbroadcastpc
@deadbroadcastpc 2 года назад
🔥 Thanks brother
@Juss_Chillin
@Juss_Chillin 2 года назад
FINALLLY!! Thanks ^^ :D
@MrRiceKrispyNotTaken
@MrRiceKrispyNotTaken 2 года назад
Hey uhh amazing tutorial dude :D but currently i'm having an issue where my door animation gets stuck from Idle to open basically it gets on a loop of door opening
@MrRiceKrispyNotTaken
@MrRiceKrispyNotTaken 2 года назад
a temp fix i did was making a idle animation of the door open in both directions
@comp3interactive
@comp3interactive 2 года назад
Uncheck Loop in your animation clips in the inspector
@MrRiceKrispyNotTaken
@MrRiceKrispyNotTaken 2 года назад
@@comp3interactive oh hey it works thanks man :D
@INullPointerException
@INullPointerException 2 года назад
Could you make another crouching tutorial where you need to hold the Crouch button? It could be very Helpfull.
@imrealgigachad
@imrealgigachad 2 года назад
Im beginner and i like your videos! I m waiting for how to add arms to a unity games
@filipurevic1969
@filipurevic1969 Год назад
Hey man, if you ever make a new episode I would love to see a leaning option. Somethink like in r6s. Love the content btw!
@sborropoly
@sborropoly 2 года назад
thank you brotha
@--cook--
@--cook-- Год назад
My door appears to open in one direction only UNLESS I interact while I jump. I've double-checked all my code and can't seem to find any error. Any fix for this?
@jud.su.5developer895
@jud.su.5developer895 2 года назад
Please how can pickup weapon with enteraction
@RedcodeSg
@RedcodeSg 2 года назад
Thank you!!!
@bcld1111
@bcld1111 2 года назад
tnx u mate i love u u hepled me a lot
@epicleo
@epicleo 6 месяцев назад
Is it possible to disabled "CanMove" using the Example interactable?
@ArzenikRawr
@ArzenikRawr 2 месяца назад
Yes
@nutsandy7183
@nutsandy7183 2 года назад
Cheers Mike, really appreciate it "}
@ahad1234
@ahad1234 2 года назад
Nice brother
@pedropc5824
@pedropc5824 2 года назад
For some reason don't work on my game, i mean, it works but don't recongnizes the side of the door where the player standing.
@jud.su.5developer895
@jud.su.5developer895 2 года назад
How can we pick up weapons?
@molnardavid722
@molnardavid722 2 года назад
One way, it s opening only if i m looking at the hinge of the door
@Keylonproductions
@Keylonproductions 2 года назад
Swimming?
@dragonballz3686
@dragonballz3686 2 года назад
I have a doubt sir. In my game, I am having a shooting bar. Which means , If I hold the shoot button, then the shooting bar gets decreased and if the bar is at 0 then the player should stop shooting. And the shooting bar regenerates. Problem is if I press the shoot button it is decreasing but it is not stopping to shoot. It is continuously shooting after bar is at 0 while holding the button. And I solved this problem by using setactive. But after that, another problem came, that is, if I press the button, it is not shooting after the bar is 0, yeah that's fine, but the bullets are only disabled, so it is creating many disabled bullets in hierarchy. What should I do sir plz 😥😥
@jud.su.5developer895
@jud.su.5developer895 2 года назад
Please part 13
@jud.su.5developer895
@jud.su.5developer895 2 года назад
EP (13)?
@SeaFoamStrat
@SeaFoamStrat 2 года назад
Great tutorial! I am having one issue though; when looking directly at the door straight on from either side, it only plays the 'open in' and 'close from in' animations. But when I look at the door from an angular position, it will play the 'open out' and close from out' animations. Not sure where I goofed but any help would be appreciated! Again, thank you for all of the tutorials!
@LM-cc7qz
@LM-cc7qz 2 года назад
You need to make sure that the front/back of the door is aligned on the z axis not the x.
@sborropoly
@sborropoly 2 года назад
bro u left a 1 hour video of sheep sound in your playlist
@comp3interactive
@comp3interactive 2 года назад
Holy shit I have no idea how I managed to add that in there... I play that kinda stuff for my dog because I love his reactions 😂 must have been drunk... Good spot though!
@sborropoly
@sborropoly 2 года назад
@@comp3interactive no worries bro! can u answer to my question in the footsteps video pls? i cant understand how to fix that problem.
@Injabsful
@Injabsful Год назад
hinges
@ivensauro
@ivensauro 2 года назад
Hi, if you walk on the diagonal, the player has more speed than walking just in one direction? because i don't see you normalizing the move input vector
@TheGaured
@TheGaured 2 года назад
Is it possible for you to make a tutorial on Double Jumping Please it will be very helpful 👍
@Vanduo610
@Vanduo610 2 года назад
I have checked my Interactable script it is working but when press E or any other... to open doors it does not work. My DOOR script:using System.Collections; using System.Collections.Generic; using UnityEngine; public class DOOR : Interactable { private bool isOpen = false; private bool canBeInteractedWith = true; private Animator anim; private void Start() { anim = GetComponent(); } public override void OnFocus() { } public override void OnInteract() { if (canBeInteractedWith) { isOpen = !isOpen; Vector3 doorTransformDirection = transform.TransformDirection(Vector3.forward); Vector3 playerTransformDirection = PlayerMovement.instance.transform.position = transform.position; float dot = Vector3.Dot(doorTransformDirection, playerTransformDirection); anim.SetFloat("dot", dot); anim.SetBool("isOpen", isOpen); } } public override void OnLoseFocus() { } } My Interactable script: using System.Collections; using System.Collections.Generic; using UnityEngine; public abstract class Interactable : MonoBehaviour { public virtual void Awake() { gameObject.layer = 9; } public abstract void OnFocus(); public abstract void OnInteract(); public abstract void OnLoseFocus(); } and script: [Header("Interactable")] [SerializeField] private Vector3 interactionRayPoint = default; [SerializeField] private float interactionDistance = default; [SerializeField] private LayerMask interactionLayer = default; private Interactable currentInteractable; also (void Update) if (canInteract) { HandleInteractionCheck(); HandleInteractionInput(); } also private void HandleInteractionCheck() { if (Physics.Raycast(playerCamera.ViewportPointToRay(interactionRayPoint), out RaycastHit hit, interactionDistance)) { if (hit.collider.gameObject.layer == 9 && (currentInteractable == null || hit.collider.gameObject.GetInstanceID() != currentInteractable.GetInstanceID())) { hit.collider.TryGetComponent(out currentInteractable); if (currentInteractable) currentInteractable.OnFocus(); } } else if (currentInteractable) { currentInteractable.OnLoseFocus(); currentInteractable = null; } } Edit: in console I get no errors. I checked animations.... everything is fine.
@EpicVaffi
@EpicVaffi 2 года назад
Your line at "Vector3 playerTransformDirection = PlayerMovement.instance.transform.position = transform.position;" is wrong. It should be "Vector3 playerTransformDirection = PlayerMovement.instance.transform.position - transform.position;" with a substract at the end instead of equals
@Vanduo610
@Vanduo610 2 года назад
@@EpicVaffi Thanks.
@MarsLaaars
@MarsLaaars Год назад
does your door open both ways?
@leeoiou7295
@leeoiou7295 2 года назад
I really dislike the method you use. Using animation to open doors is all wrong because should you need to make changes in the environment, you will have to change the animation. If you used translate it in a direction based on some serialised values in the door script then it would be kind of procedural door opening and you can apply that to multiple doors facing different directions. Also, I would make use of unity events just so that this same interaction could be leveraged to use multiple types of objects with similar movement.
@ArzenikRawr
@ArzenikRawr 2 месяца назад
Womp womp
@NewYorkNixDa
@NewYorkNixDa Год назад
Ive made it easier by a script: private void OpenDoor() { if (doorTransform != null) { Quaternion targetRotation = isDoorOpen ? initialRotation : initialRotation * Quaternion.Euler(0f, doorOpenAngle, 0f); // Drehe die Tür zur Zielrotation StartCoroutine(RotateDoor(targetRotation)); // Aktualisiere den Zustand der Tür isDoorOpen = !isDoorOpen; } } private IEnumerator RotateDoor(Quaternion targetRotation) { float duration = 1.0f; float elapsedTime = 0f; Quaternion startRotation = doorTransform.localRotation; while (elapsedTime < duration) { doorTransform.localRotation = Quaternion.Lerp(startRotation, targetRotation, elapsedTime / duration); elapsedTime += Time.deltaTime; yield return null; } doorTransform.localRotation = targetRotation; } With that and the interact script ive made an switch case for all interactable things ;-)
@hawthorn_05_11
@hawthorn_05_11 2 года назад
it works, just not according to where I'm standing. my code is correct isn't it? I've checked it over twice now. public class Door : Interactable { private bool isOpen = false; private bool canBeInteractedWith = true; private Animator anim; private void Start() { anim = GetComponent(); } public override void OnFocus() { } public override void OnInteract() { if (canBeInteractedWith) { isOpen = !isOpen; Vector3 doorTransformDirection = transform.TransformDirection(Vector3.forward); Vector3 playerTransformDirection = FirstPersonController.instance.transform.position - transform.position; float dot = Vector3.Dot(doorTransformDirection, playerTransformDirection); anim.SetFloat("dot", dot); anim.SetBool("isOpen", isOpen); } } public override void OnLoseFocus() { } AND, in FirstPersonController.cs I have public static FirstPersonController instance; under the private float rotationX = 0; AND instance = this; in awake please help :)
@SeaFoamStrat
@SeaFoamStrat 2 года назад
I'm having the same issue; looking at the door straight ahead, it only plays the open in animation and pushes your character out of the way. If I look toward the hinge of the door at an angle, it plays the correct animation.
@LM-cc7qz
@LM-cc7qz 2 года назад
You need to make sure that the front/back of the door is aligned on the z axis not the x.
@hawthorn_05_11
@hawthorn_05_11 2 года назад
​@@LM-cc7qz "so that was a fucking lie" - Tyler, the Creator. Unless you mean in blender
Далее
3 Hours vs. 3 Years of Blender
17:44
Просмотров 4,7 млн
How I Remade MW2 with Unreal Engine 5
12:37
Просмотров 3,1 млн
An introduction to Shader Art Coding
22:40
Просмотров 968 тыс.
2D Field of View [Unity Tutorial]
18:08
Просмотров 15 тыс.
How to ACTUALLY get into Gamedev
14:01
Просмотров 721 тыс.