Why Building a C++ Component in Unreal Engine is Easier Than You Think!

Поділитися
Вставка
  • Опубліковано 12 гру 2023
  • The Unreal Engine is a powerful tool to create any game you can imagine. Blueprints are integral, but incorporating C++ opens a world of opportunities. This comprehensive video series is designed to guide you through every aspect of C++, starting from the basics to advanced techniques.
    We will create our first Actor Component in this Video. This Video will teach you how to create variables and how to assign variable values inside the property window. It's not just a lesson, it's the beginning of your thrilling C++ Odyssey in game development with Unreal Engine!
    Important URL's:
    - How to setup VSCode for Unreal Engine C++: docs.unrealengine.com/5.0/en-...
    - ActorComponent Class Templates: github.com/ascripture/UnrealC...
    #unrealengine
    #cpp
    #unrealengine5
    #gamedev
    #programming
    #development

КОМЕНТАРІ • 58

  • @drili3771
    @drili3771 4 місяці тому +11

    Hope you get more views, the quality and content of the video is great. Keep up the good work!

    • @ScriptedAdventure
      @ScriptedAdventure  4 місяці тому

      Thank you so much for your comment. I really appreciate it!

  • @russsully3192
    @russsully3192 4 місяці тому +4

    Awesome work! I will be waiting for the next videos!!!

  • @Dominicn123
    @Dominicn123 4 місяці тому +4

    bro, this is exactly what i've been looking for i am so happy lol i've been working in unreal for a year and learned BP but only recently decided to learn C++ over the last few weeks, the only issue is that i don't exactly understand HOW to use it in unreal, this may be exactly what i've been looking for i am so excited!!! i really hope that it's what i mentioned lol because i tried making a new project in C++ and was so confused by how it even works, like opening a project the next time was confusing, i THINK you have to open up visual studio first, and then compile the cpp file, OR in the project, compile via Live Coding first, i don't know.... thats what i mean lol... please please cover those aspects! i've subbed and hit the bell!!

    • @ScriptedAdventure
      @ScriptedAdventure  4 місяці тому

      Thank you so much! In general it is best when you open the project in Visual Studio, do your changes and then recompile the project. Don't bother with Live Coding for now. Instead of Visual Studio I can also recommend Rider. www.jetbrains.com/lp/rider-unreal/
      In February I plan to release a video where we implement a mini-game. So this should be fun. :)

    • @aliksargsyan2782
      @aliksargsyan2782 3 місяці тому

      ​@@ScriptedAdventurewhat about CLion ?

    • @ScriptedAdventure
      @ScriptedAdventure  3 місяці тому

      CLion is great but it's better suited for general purpose C++.

    • @DRockafella
      @DRockafella Місяць тому +1

      @@ScriptedAdventure What is Rider better suited for? And how is the "mini-game" tutorial coming along?

  • @drakouzdrowiciel9237
    @drakouzdrowiciel9237 Місяць тому

    Good job.

  • @tnlfla1me746
    @tnlfla1me746 27 днів тому

    Can you make video where you setup vscode for ue5

  • @nairolfri
    @nairolfri 3 місяці тому +1

    Really clear video, keep it up !
    Maybe I would remove the music, if I want to listen music I can add it, if I want to focus I usually prefer having only the voice (mostly because english is not my first langage)

    • @ScriptedAdventure
      @ScriptedAdventure  3 місяці тому

      Thanks for your feedback! I agree the music can be distracting. I guess I'll use it more sparingly in future videos.

  • @Galagnoth
    @Galagnoth Місяць тому

    Thank you so much for creating these videos!

  • @hyper_1337
    @hyper_1337 3 місяці тому +1

    Hi, thanks for this video. Can you please explain to me how to use unreal with Visual Studio Code. I'm using Visual Studio but it has some build issues and also it made me install a lot of stuff to use it with unreal

    • @ScriptedAdventure
      @ScriptedAdventure  3 місяці тому

      Can you share the issues you have? If you have trouble installing Visual Studio, I can record another video showing how to install different IDE's for unreal (Visual Studio, IntellJ Rider etc.). Would this help?

    • @vladdimitrov819
      @vladdimitrov819 Місяць тому

      ​@@ScriptedAdventureinstalling Rider and opening a project that was created as a blueprint project initially would be an amazing tutorial!

  • @wufe
    @wufe 26 днів тому

    Thanks for your work!
    I'm new to Unreal Engine, but I'm wondering why in every tutorial I see online the flow is to change code -> start debugging from IDE -> wait for Unreal Engine to start up -> test the code.
    So my question is: isn't the "live coding" feature good enough?
    In my workflow I keep Unreal open all the time, then apply some changes to the C++ code in the IDE, hit to recompile all and the Unreal popup for the live coding shows up, telling me that it has patched the code in real time.
    Is this workflow sustainable?
    (BTW I'm using Jetbrains Rider as IDE, but I found this workflow working also with Visual Studio Community, except for when updating plugins code)

    • @ScriptedAdventure
      @ScriptedAdventure  26 днів тому

      Hey there, thank you for your comment. Unfortunately, I didn't cover the topic of live coding in this tutorial.
      Live coding is absolutely fine to use and will significantly improve your development speed. However, there are a couple of cases where I would suggest compiling from the IDE instead. These cases include making changes to class structure or touching any configuration files.
      In older versions of Unreal, the hot reloading feature was quite buggy. I suppose this is why many tutorials don't touch this topic, as people who were used to rebuilding all the time need to relearn this as a new habit.

  • @RDD87z
    @RDD87z 4 місяці тому

    awesome video, thank you for sharing. Its so sad that its giving so much problems to create a simple code. requires to restart, recompile etc to make everything look clean. i really hope ue fix this one day or maybe make its own IDE inside the ue without all these problems.

    • @ScriptedAdventure
      @ScriptedAdventure  4 місяці тому

      VSCode isn't the best editor for unreal unfortunately. Most of the issues presented in the video can easily be fixed by using a dedicated IDE like www.jetbrains.com/lp/rider-unreal/

  • @jackk724
    @jackk724 18 днів тому +1

    To all the people commenting that Unreal looks cumbersome and difficult to setup even a single class that's due to the way the creator approached it.
    There's absolutely no reason to create your own .h and .cpp in VSCode the way he did. If he had just taken the first approach of creating a class through the editor he would have a working class without any include errors skipping all the additional steps.
    It's a REALLY strange approach to take based on the title of the video. But I think the idea was to introduce exactly what is happening and explaining the code step by step so you actually learn what's going on. If this was titled something like, What is happening in Unreal C++. Or something like that, expectations would have been better met.

  • @unrealenginecprogrammingfo4850
    @unrealenginecprogrammingfo4850 Місяць тому

    these videos are really good

  • @hamzakazmi1451
    @hamzakazmi1451 4 місяці тому

    also on 5:10 when you said to close the engine and then recompile, did you mean close unreal then clicking the build solution option?

    • @ScriptedAdventure
      @ScriptedAdventure  4 місяці тому

      Yes when you do changes in the code you should restart the engine by closing it and then rebuilding the solution.

    • @user-oz5ir2wc8z
      @user-oz5ir2wc8z Місяць тому

      ​@@ScriptedAdventure there is a button at the bottom right of the unreal engine editor to recompile the code while the editor is open

  • @hamzakazmi1451
    @hamzakazmi1451 4 місяці тому

    Also is there a certain sequence of things such as first open unreal, click refresh vscode, then open then make changes, then build, then apply changes in unreal?

    • @ScriptedAdventure
      @ScriptedAdventure  4 місяці тому +1

      Yes the usual sequence is:
      1. Close Unreal Engine
      2. Create class files (.h/.cpp) or modify existing ones
      3. Compile the changes
      Refreshing the visual studio code project is only necessary when you actually created a new header file.

  • @usmankhawar888
    @usmankhawar888 3 місяці тому

    You created a new blueprint class and drag that component to the map. Can this part be achieved with coding as well?

    • @ScriptedAdventure
      @ScriptedAdventure  3 місяці тому

      Yes this can be achieved in multiple ways. You can create a C++ actor class and drag it into the scene via the "Place Actors" Window. (docs.unrealengine.com/5.3/en-US/placing-actors-in-unreal-engine/)
      Or if you want to dynamically spawn actors you can use the SpawnActor function (docs.unrealengine.com/4.26/en-US/ProgrammingAndScripting/ProgrammingWithCPP/UnrealArchitecture/Actors/Spawning/)

    • @usmankhawar888
      @usmankhawar888 3 місяці тому

      @@ScriptedAdventure Thanks

  • @hamzakazmi1451
    @hamzakazmi1451 4 місяці тому

    I don't understand my issue, i created 2 files, one cpp and one header (no errors at all) but when build my project i get build errors, how does that make sense

    • @ScriptedAdventure
      @ScriptedAdventure  4 місяці тому

      Can you post the build errors here? Then I can take a look.

  • @yakovAU
    @yakovAU 22 дні тому

    I want to make a voxel game in UE5 but most of the resources are in unity or I need to use a plugin. doing it myself is probably out of the realm of my ability lol

    • @ScriptedAdventure
      @ScriptedAdventure  8 днів тому

      Do you have any particular games in mind? I have never played any voxel game to be honest :D

    • @yakovAU
      @yakovAU 8 днів тому

      @@ScriptedAdventure 7 days to die and enshrouded have good voxel engines

  • @GamerChunkZ
    @GamerChunkZ Місяць тому

    👏

  • @ddrr6401
    @ddrr6401 20 днів тому

    which mic you use bro

  • @andreassvensson811
    @andreassvensson811 4 місяці тому

    You managed to fool me with the video title until this point: "4:15" from there the tempo of the video and complicated issues made me lose patience and interest haha. Suddenly things feel unseemly complicated and the flow of the video disappear. Other than that you had a nice flow going on making things feel and look easy! =) Keep it up.

    • @ScriptedAdventure
      @ScriptedAdventure  4 місяці тому +1

      Thank you for your comment! Most of the issues related to Visual Studio Code can be easily skipped when using Rider. www.jetbrains.com/lp/rider-unreal/

    • @andreassvensson811
      @andreassvensson811 4 місяці тому

      @@ScriptedAdventure Thanks for sharing, looks interesting :)

  • @creationallabs
    @creationallabs 4 місяці тому +1

    Imagine prototyping in this thing, a pure nightmare.

    • @earlnuclear
      @earlnuclear 4 місяці тому +1

      You can prototype with blueprint noodles and minimal c++ with no issues, however you most likely will have issues scaling the project up. This isn't even specific to unreal or gamedev, most software projects at a core can be prototyped into their basic approximations fairly quickly.
      Components however are very good for actual architecture of your game as they can be easily reused and refactored if need arises. For example if you are making an rpg you can make an inventory component, which then can be used not only on player and enemies, but also on chests and anything that needs storage. Its a good way of breaking up your code so you don't end up with horrible monolithic god classes.

  • @Bizarium_
    @Bizarium_ 23 дні тому +3

    Great video, but there is gennuanly no way you sitting there explaining how to create a variable, we know how to do that, i feel like you don't quite have the right target with this video. Just trying to help :D

    • @RyanMcEachern-mr7jc
      @RyanMcEachern-mr7jc 2 дні тому

      His focus is beginner friendly nothing wrong with that approach

  • @GameShorts484
    @GameShorts484 4 місяці тому +9

    most useless game engine for coding. need to work 10x more than unity to compile even a simple script.

    • @natemorga
      @natemorga 4 місяці тому +4

      Yeah i dont even know why you would use this the time to make that box turn was way too long...

    • @clifforderskineart
      @clifforderskineart 4 місяці тому +3

      Yeah I kind of felt the same way, this could be done in a fraction of time in Unity. But UE5 does have some amazing art features built in.
      Its a shame its not very realistic to build a game in Unreal Engine for the solo dev

    • @GameShorts484
      @GameShorts484 4 місяці тому +2

      ​@@natecoley160and they put a showcase about their "pre-rendered" game to youtube and put a title that is like "unreal engine insane graphics fan game - I just did it in one day!" and when you open the video, you see that only one character just walking. worse part is that people are giving thousands of likes and they have no idea what game developing is actually.

    • @tatoforever
      @tatoforever 4 місяці тому +9

      Because thats how you make big scalable games.

    • @shannenmr
      @shannenmr 4 місяці тому +16

      Yes the most used game engine by AAA Studios is the most "useless for coding" outside of it it being the fastest performance wise and having the engine source code fully available for you to modify or just read through and understand... now days with live coding so long as you only Include What You Use compile times are negligible.
      This example is a bit contrived and not how you would usually make something rotate, its designed to show you could take some specific code that might be running slow in BP (large loops, large arrays, a lot of looping math) and move it to a C++ component where you can call it from your existing BP code to have the best of both worlds.