C++ Collision and Delegates UE4 / Unreal Engine 4 C++

  Рет қаралды 28,386

Dev Enabled

Dev Enabled

Күн бұрын

UE4 C++:
This playlist covers various aspects of working with C++ inside of the Unreal Engine.
This Video:
In this video, we cover the process of working with any collision events in Unreal C++. This video specifically looks at BeginOverlap events but the process and logic are the same for any other Overlap or even Hit events.
Links:
The beginning of this playlist: bit.ly/CPPOverv...
Download projects from any complete tutorial series and more: github.com/Dev...
Consider supporting the channel on Patreon: / devenabled
My First Pluralsight Course: app.pluralsigh...
My Second Pluralsight Course: www.pluralsigh...
My Third Pluralsight Course: app.pluralsigh...
Check out my Website: devenabled.com/
Twitter: / robbcreates
Sound Effects (BFXR): www.bfxr.net/
Get Affinity Designer: affinity.serif...
Get Unreal: www.unrealengi...
Get Some great free assets here: www.gamedevmar... Gamedev.tv Courses - Affiliate Links:
Unreal C++ Developer: www.gamedev.tv...
Unreal Multiplayer: www.gamedev.tv...
Unreal Blueprints: www.gamedev.tv...
Blender Characters: www.gamedev.tv...

Пікірлер: 57
@DevEnabled
@DevEnabled 5 жыл бұрын
In this video, we cover the process of working with any collision events in Unreal C++. This video specifically looks at BeginOverlap events but the process and logic are the same for any other Overlap or even Hit events.
@kinglogan4029
@kinglogan4029 3 жыл бұрын
You all probably dont give a damn but does any of you know of a tool to get back into an Instagram account?? I was dumb lost the password. I appreciate any tricks you can give me.
@lochlanseth9092
@lochlanseth9092 3 жыл бұрын
@King Logan Instablaster :)
@kinglogan4029
@kinglogan4029 3 жыл бұрын
@Lochlan Seth Thanks so much for your reply. I got to the site on google and I'm waiting for the hacking stuff now. Takes quite some time so I will get back to you later when my account password hopefully is recovered.
@kinglogan4029
@kinglogan4029 3 жыл бұрын
@Lochlan Seth it did the trick and I actually got access to my account again. I am so happy! Thanks so much you saved my ass :D
@lochlanseth9092
@lochlanseth9092 3 жыл бұрын
@King Logan No problem :)
@bulentgercek
@bulentgercek 3 жыл бұрын
04:13 I can't find anything like this in documentation on the same page. Are they deleted it? What happened to this nice documentation?
@alexheuman3586
@alexheuman3586 3 жыл бұрын
It's there buddy in the C++ API. How are you gonna learn how to make games if you can't read and insist on insulting the documentation?
@niodyan4476
@niodyan4476 3 жыл бұрын
@@alexheuman3586 Look, I got the documentation website and only get this absolute shite: docs.unrealengine.com/en-US/API/Runtime/Engine/Components/UPrimitiveComponent/OnComponentBeginOverlap/index.html
@marshall7254
@marshall7254 3 жыл бұрын
The documentation has been updated and no longer contains the example code / signature referenced in the video, I looked around for another example but I couldn't find one easily so I just copied it out of the video if anyone else wants it: OnOverlapBegin(UPrimitiveComponent* OverlappedComp, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
@alexheuman3586
@alexheuman3586 3 жыл бұрын
It's there docs.unrealengine.com/en-US/ProgrammingAndScripting/ClassCreation/CodeOnly/index.html
@aironebush346
@aironebush346 3 жыл бұрын
mvp
@dgrins552
@dgrins552 Жыл бұрын
legend, thank you!
@NJLStudios1
@NJLStudios1 Жыл бұрын
@@alexheuman3586 good looks
@dawne2780
@dawne2780 2 жыл бұрын
Why can I not find any example code in unreal's docs?
@nikoszervo
@nikoszervo 2 жыл бұрын
It seems that it's true that UE's C++ API is a Mess and that the docs can't help you much...Even if you are a C++ dev like me... I'm probably gonna give up and return to Unity, I don't like blueprints at all because I want to write actual code.
@DevEnabled
@DevEnabled 2 жыл бұрын
Unity can be good too.
@leeoiou7295
@leeoiou7295 Жыл бұрын
exactly. I prefer c++ to c# but unreal will make you hate c++ because of their useless documentation. As for blue-print, I would rather write assembly code than use blueprints. lol.
@SiberianSoftware
@SiberianSoftware 7 ай бұрын
Unreal C++ documentation is indeed very poor with no code samples. You have to fish samples from the videos like this. But I'll not go to Unity, I'll continue to suffer with Unreal code.)
@unrealdevop
@unrealdevop 6 ай бұрын
First of all thanks for the video. Secondly I would like to note how much I hate what they have done to the documentation. It's basically 100% useless now. The delegate signature isn't even available from the documentation anymore and I had to find it in the Source Code.
@HonsHon
@HonsHon Жыл бұрын
looks like they really shafted their documentation recently. They show nothing of this caliber now :(
@my4127
@my4127 2 жыл бұрын
In AYTCharacterBase::OnOverlapBegin(), you will have a crash when colliding with an interactable object while not focusing on it. Make sure to check that "FocusedActor is equal to OtherActor" before calling Interface->Execute_OnInteract().
@AdrenResi
@AdrenResi 4 жыл бұрын
BP_Character's MeshComp should be set to all Overlap BP_Character's CapsuleComponent should be set to Ignore Visibility and Block everything else. BP_Interactable's Cube should be set to Block Visibility and Overlap everything else. You *don't* need to uncheck the "Do Collision Test" in BP_Character's SpringArmComp when you overlap camera visibility from the interactable cube. Can't create delegates (or dynamic code) in the constructor. It must be in BeginPlay. When overriding BeginPlay, you need to have Super::BeginPlay or else you can't move the mouse or directional keys.
@NJLStudios1
@NJLStudios1 Жыл бұрын
This is a valuable comment. Thank you!
@DeclanCrane
@DeclanCrane 5 жыл бұрын
Please keep these up man, great as always
@asherscott3151
@asherscott3151 3 жыл бұрын
Mine worked without overriding begin play
@jenniferalderson6875
@jenniferalderson6875 4 жыл бұрын
Oh gosh, I've wasted so much time trying to understand why my delegate in constructor doesn't work. Thank you sooooo much!!! Awesome tutorial!
@DevEnabled
@DevEnabled 4 жыл бұрын
No worries, happy to help.
@tommybazar
@tommybazar 4 жыл бұрын
The issue in constructors is that you shouldn't add anything dynamic in them. Everything dynamic should go into BeginPlay. I've had this bite me in the ass before - for example - creating Dynamic material instances in constructors won't work etc.
@DevEnabled
@DevEnabled 4 жыл бұрын
Yeah, they can be a bit of strange one. It can definitely cause issues storing dynamic variables in them but things like the mesh which you'd already need to have defined in the header should be readily accessible there to reference.
@Naeyx
@Naeyx 3 жыл бұрын
Thank you thank you thank you! I couldn't figure out why my events weren't firing. I was following the example posted above where they were put in the constructor and it wasn't working. Moved it to begin play and worked!
@tommiemartin1596
@tommiemartin1596 2 жыл бұрын
mesh collision has a slightly different signature than box or sphere collision. That's the part that was throwing me off.
@СчастливыйЧеловек-х9с
@СчастливыйЧеловек-х9с 3 жыл бұрын
Please tell me how you can do cast without overlapped?
@LameDuckStudios
@LameDuckStudios 4 жыл бұрын
It's not necessary to disable camera collisions. Instead, in the collision channels of the mesh, set the camera channel to ignore. Though I'm curious to why you chose a static mesh over using a box collision component? My understanding is the collision components are cheaper to run.
@DevEnabled
@DevEnabled 4 жыл бұрын
A collision update is going to be about the same and the only reason it would be cheaper is that it's not rendering but we have the cube as a visual representation any so rather than stacking up the components I've just used the collision on the cube that's readily available.
@LameDuckStudios
@LameDuckStudios 4 жыл бұрын
@@DevEnabled Good to know. Thanks.
@PrabhjotSingh_
@PrabhjotSingh_ 2 жыл бұрын
Thanks for great tutorial
@gabrielepardi5178
@gabrielepardi5178 3 жыл бұрын
Thanks: it looks in 4.26 they fixed the issue about constructor.
@DevEnabled
@DevEnabled 3 жыл бұрын
Handy to know, thanks.
@borbling
@borbling 4 жыл бұрын
THANK YOU SO MUCH!!!
@SeyferStudios
@SeyferStudios 3 жыл бұрын
Excellent work!
@zep_value
@zep_value 2 жыл бұрын
I really enjoy the way you explain complex physics ! I have been working as a software dev for a while and it ticks me a bit to find the optimal performance for programs/games. Why aren't we using the onHit since all we need to do is catch the event of the collision and make the grey cube disappear ? isn't the overlap kinda an overkill ? Thanks again for your content :D
@DevEnabled
@DevEnabled 2 жыл бұрын
Same complexity for different goals. Do you want your object to be physically blocked or stopped and return details? Use Hit. Do you want to just know when two things are in the same space but not necessarily move eachother out of the way, for example a checkpoint, use Overlap.
@zep_value
@zep_value 2 жыл бұрын
@@DevEnabled Watching your amazing tutorial also cleared that question for me :D kzbin.info/www/bejne/gYLKgKSvjtR7d9U
@tacca4720
@tacca4720 3 жыл бұрын
Another brilliant tutorial, thank you.
@DevEnabled
@DevEnabled 3 жыл бұрын
You're very welcome!
@6r0m
@6r0m 5 жыл бұрын
did you try restart editor for constructor changes take affect?
@DevEnabled
@DevEnabled 5 жыл бұрын
I think I have in previous tests and that doesn't always work from the results I remember getting so I've tried providing a fail-safe approach.
@6r0m
@6r0m 5 жыл бұрын
no problems) thank for the video! but hot reload buggy working with constructors and with some changes in header files, try it for confirm when you have a free time. I'm always restarting editor with these changes otherwise to find why and what - will be very difficult.
@KUNALSINGH-zk8su
@KUNALSINGH-zk8su 3 жыл бұрын
Sir at 9:09 I have done like you but I am getting this error :- error C2039: 'Execute_OnInteraction': is not a member of 'IInteraction_Interface'.......can you tell me why?Thankyou.
@erikpolygon5471
@erikpolygon5471 4 жыл бұрын
But what if i have about 100 enemys of the same type in the game. Do i have to add my function to every instance of the enemys?
@alexheuman3586
@alexheuman3586 3 жыл бұрын
Make a class that all the enemies inherit from
@erikpolygon5471
@erikpolygon5471 4 жыл бұрын
Did they changed the Documentation? Its extremly bad now with absolutly no example and just a very short explenation.
@DevEnabled
@DevEnabled 4 жыл бұрын
I think they have been going through updating the documentation. I know they've made the includes much easier to find which is nice. Not sure if they're also simplifying some of the examples for some reason though.
@erikpolygon5471
@erikpolygon5471 4 жыл бұрын
Oh, and great Video!
@erikpolygon5471
@erikpolygon5471 4 жыл бұрын
@@DevEnabled ok, thank you. I dont really understand delegates or what AddDynamic really does. Do you maybe have a short explanation for me ? (:
@IsekaiedxRimuruTx
@IsekaiedxRimuruTx 4 жыл бұрын
they did really removed all the coding on the docs but only give explanation this is really bad , i cant find the code u are referring in the video , so i m stuck they update it and make it worst , all coding sample is gone now :(
C++ Health & Damage System UE4 / Unreal Engine 4 C++
16:57
Dev Enabled
Рет қаралды 24 М.
C++ Timeline Float Animation UE4 / Unreal Engine 4 C++
11:00
Dev Enabled
Рет қаралды 15 М.
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 257 МЛН
规则,在门里生存,出来~死亡
00:33
落魄的王子
Рет қаралды 25 МЛН
escape in roblox in real life
00:13
Kan Andrey
Рет қаралды 93 МЛН
БЕЛКА СЬЕЛА КОТЕНКА?#cat
00:13
Лайки Like
Рет қаралды 2,6 МЛН
How to make a guns.lol page (tutorial)
5:16
JACKYBOY1356
Рет қаралды 4
UE4 c++ Event Dispatchers syntax
10:56
Matthew Hennegan
Рет қаралды 28 М.
Blueprints vs. C++: How They Fit Together and Why You Should Use Both
47:14
The Unreal Engine Game Framework: From int main() to BeginPlay
27:22
Alex Forsythe
Рет қаралды 211 М.
C++ Line Trace UE4 / Unreal Engine 4 C++
13:55
Dev Enabled
Рет қаралды 19 М.
Unreal Engine 4 UI: C++ & Blueprints UMG Workflow Tutorial
14:15
UNREAL ENGINE | EVENT DISPATCHERS (BP) + DELEGATES (C++)
5:01
Unreal Engine Interfaces: Everything you need to know #2 C++ Implementation
14:43
UMG Widgets with C++ in Unreal Engine 5
16:09
Lively Geek
Рет қаралды 38 М.
C++ Delegates for Unreal Engine in 5 Minutes!
5:22
Pobato Tutorials
Рет қаралды 1 М.
Will A Guitar Boat Hold My Weight?
00:20
MrBeast
Рет қаралды 257 МЛН