How To Use Cast Nodes And Why You Actually Want To Use Interfaces Instead - UE4/UE5 Blueprints

  Рет қаралды 49,975

GDXR

GDXR

Күн бұрын

Пікірлер: 151
@JesseLeeHumphry
@JesseLeeHumphry 3 жыл бұрын
This is a pretty solid tutorial. Casting v. Interfaces are really important. A few notes I don't think you covered in the video but that I wanted to point out to the curious. 1. Interfaces are *technically* still casting, they're just not casting to the main class. Unreal has multiple inheritance, and when you "implement" an interface, that class is actually inheriting from the interface's object. So an interface message is casting to that inherited interface object. It's just a much leaner, more portable operation. 2. Interfaces are typically meant for objects that aren't at all on each other's inheritance trees, like your usage of lights and the player character. If they're on the same inheritance tree, they should have a parent that has the desired event, and that parent is the class you cast to. 3. There are big dependency and memory implications around casts in Blueprint specifically; namely that casts invoke references even if the reference isn't stored. That reference is loaded into memory on startup. If you're casting directly to an actor that you aren't positive is in the level, you're taking up memory on startup. It's quickly garbage-collected because Unreal is badass, but it'll impact load times. 3a. Because casting loads a reference into memory (whether present in the level or not), it also loads THAT classes references into memory. If your character casts to a boss that isn't in the level, you'll load the boss's class into memory, and then you'll load anything the boss references, and so on. This can be a ballooning problem, and interfaces help curtail that. Solid video! I do think it was a tad bit long but you definitely got your point across!
@GDXR
@GDXR 3 жыл бұрын
Thank you for posting this. It should be extremely helpful for those wanting more information.
@50shadesofskittles9
@50shadesofskittles9 2 жыл бұрын
@@GDXR agreed
@3DWithLairdWT
@3DWithLairdWT 2 жыл бұрын
Absolutely love how clear this description is A+
@Trait74
@Trait74 2 жыл бұрын
Lifesaver information here! thank you very much!!!
@null643
@null643 Жыл бұрын
So basically if I just want to fire an event, I should always use interfaces to avoid references in memory . But directly edit a variable, use a cast? Still a bit confusing to me
@CraftyMaelyss
@CraftyMaelyss Жыл бұрын
Mate, you are an absolute *lifesaver* I got so mad since people kept saying 'use a reference' or 'you're not casting properly' without explaining *why* that was the case. Seriously, you've really helped so much by explaining this where a lot of other people don't :)
@Chrasmardan
@Chrasmardan Ай бұрын
Casting has been so confusing, two months in to learning UE5. This is a game changer lol, thanks so much!
@benjaminbristow
@benjaminbristow 3 жыл бұрын
I'm a solo dev but I love making things modular for some reason. Maybe one day I can put stuff onto the market place. Love your tutorial videos!
@GDXR
@GDXR 3 жыл бұрын
Make it Modular is my Moto lmao. If you work Modular your less likely to bite your self in the but later down the line. It's a great way to think of things. When you do get something on there let me know. I'd love to see it. And thank you :)
@MGInspiration
@MGInspiration 2 ай бұрын
I'm newbie in UE, love to learn with you, it's easy to understand .Thanks You
@xenaisu
@xenaisu Жыл бұрын
Thank you so much dude, been scratching my head for 6 hours and looked up multiple tutorials on the blueprint interface and only with your tutorial I finally got it to work.
@mrorange159
@mrorange159 8 ай бұрын
This is by far one of the most logical and straight forward tutorials I've come across that explains casting. Thanks very much!
@steveg7292
@steveg7292 Жыл бұрын
This has been pissing me off for the past 2 days trying to figure this out and you explained it perfectly in 5 minutes. Gonna be watching all your videos now! Thanks so much man your a great teacher.
@shaneruetz5604
@shaneruetz5604 3 жыл бұрын
Can confirm, this used to drive me nuts, to the point where I would avoid casting all together haha. Good video!
@rochaleo19
@rochaleo19 Жыл бұрын
I though that Interfaces were difficult before watching this video. Really helped. I was doing a total mess with casting. I just replaced a huge branching structure containing lots of casts to simply interfacing correctly.
@GDXR
@GDXR Жыл бұрын
Interfaces rule !!!
@motenai82
@motenai82 Жыл бұрын
This might be the first channel that find about Unreal with in depth explanations of what you should do on a given subject, instead of flashy basic examples that look good and are usefule in the first 2 hours of learning Blueprints. Nicely done man!
@ecoclasico
@ecoclasico 2 жыл бұрын
Great tutorial!! I'd like to apport a tip that I don't know if it could be useful: When you created the "ActorsToActive" array, you used a ForLoop to call the "Activate" Event. If you just plug the ActorsToActive array to Activate Event directly, it applies automatically to all actors with Active Interface without the need to use ForLoop
@fonfel94
@fonfel94 2 жыл бұрын
Thanks a lot, man. I was trying to figure out how to make a door that opens when you step on a platform that is nowhere near that door, so I couldn't use any "on component begin overlap" and struggled to make this work. Your light example was perfect for this.
@lildevilgamer
@lildevilgamer 3 жыл бұрын
In the first example with the light when you get the note that bp_light is already bp_light wouldn't you be able to just get the bp_light and drag of the "turn light on" of off it without casting?
@WilliamMullins
@WilliamMullins 3 жыл бұрын
Yeah, you would be able to. I think you would still need to make the variable public and manually set the reference in the scene, otherwise it won't have a proper reference, but it would work. I'm guessing they didn't point it out since the episode is about casting specifically.
@GDXR
@GDXR 3 жыл бұрын
I dont think I could have said it better than William. You tottaly can do that but i specificaly wanted tot explain casting and typical errors. It was just the easiest way i could think of to explain the over all concept.
@Switch620
@Switch620 2 жыл бұрын
If the error is that the object is already a BP_Light.... that just means you don't need to need to cast it, and you can just call "Turn Light On" without casting. You've already set it in the editor that it is BP_Light, so the editor knows. By changing it to actor, then casting it to BP_Light, you're just adding unnecessary steps.
@3DWithLairdWT
@3DWithLairdWT Жыл бұрын
This comment is underrated. The description of casting in the video is going to be quite misleading for newcomers
@dreambadger
@dreambadger Жыл бұрын
Thanks for video. I'm currently learning about interfaces & components and i've watched a few of your videos today.
@mpjstuff
@mpjstuff 2 жыл бұрын
If you have trouble creating a Blueprint Interface like I did. Make sure when you Add a new Blueprint you DO NOT select the Blueprint icon, but the pop-up in the menu below it that has Blueprints > and THERE you will find that pesky BPI. So many nooks and crannies in UE and you blink and you can miss something.
@OpenMawProductions
@OpenMawProductions Жыл бұрын
What?
@danielgiambattistelli7380
@danielgiambattistelli7380 9 ай бұрын
Really cool video. At last one that makes thing a bit clear. So casting should be used on one to one communication. I really liked the for loop array with interface usage. this is super handy.
@aldystofan2196
@aldystofan2196 3 жыл бұрын
this helping me so much to understand what actually happen with that blueprint, thankyou so much Jonathan!
@GDXR
@GDXR 3 жыл бұрын
Thats awesome, I'm really glad it was helpful.
@kalewhite111
@kalewhite111 Жыл бұрын
I was looking for a decent explanation of casting for so long. Thank you.
@kyoai
@kyoai 3 жыл бұрын
I think your explanation of casting is a bit inaccurate. Casting is NOT sending information to the casted object, but casting is an attempt to convert an object/actor (or object-/actor reference) of one type to another type. The actual information sending happens after the cast, namely when you call the "Turn Light Off" function. But the casting itself is no message sending, just a conversion attempt. Casting helps us to find out whether something generic, such as an actor, is of a specific type, so we can do things with it that only the specific type can do. For example, in OnBeginOverlap where we only get the generic actor type of the actor object that overlapped. We only know that it is some kind of actor that overlapped, nothing more, and at that point we can only do things with it that a generic actor can do (set actor location, destroy actor, etc...). Games however usually have more specialized versions of actors, such as character, pick-up-items, projectiles, etc. In order to find out what kind of type an actor (or any object) is we can use casting to a specific type. If the object is of that specific type, we'll get access to its specialized features (TurnLightOff-function). If the cast fails then it means that the actor object and the type we're trying to cast to are unrelated. For example, Light and Character don't share any base class other than Actor, so if the overlapping actor is a character and we try to cast it to the Light type, the cast would fail, and then we can try to cast to another type to find out "if it's not a Light, then perhaps it is...".
@ChrisCohen
@ChrisCohen 2 жыл бұрын
@@null643 it could be negligible but probably isn't in most cases. Best to assume that casting performance impact is significant and try to avoid it where possible.
@adityasingh270
@adityasingh270 2 жыл бұрын
Thanks man was searching for a video like this for months.
@lukafi
@lukafi 3 ай бұрын
A bit long but nonetheless a great video explaining a very important feature. I've yet to completely wrap my head around this and also components but this video helps tremendously and I think I have a basic understanding of interfaces. I appreciate your work!
@chagaze7199
@chagaze7199 2 жыл бұрын
confirmed, it HELPED! Thanks a lot !!
@bamfyu
@bamfyu Жыл бұрын
This was really helpful. Thank you.
@X400DYL
@X400DYL Жыл бұрын
WOW great Tutorial, Made total sence and well explained, Thanks Subbed
@GDXR
@GDXR Жыл бұрын
Thanks for the sub!
@CGDive
@CGDive Жыл бұрын
This is very well explained and useful. Thank you!
@MatyasCensky
@MatyasCensky 8 ай бұрын
Very well explained, great examples. Thanks
@DesertStormXQ
@DesertStormXQ 3 жыл бұрын
very easy to understand, I like the way he instructs, i am new with blueprint and his teaching made me understand many things, thank you
@GDXR
@GDXR 3 жыл бұрын
Your welcome, super pleased it was helpful.
@lasereye159
@lasereye159 2 жыл бұрын
Dude, i have to thank you. Very clear explanation, good speed.
@jonny0_0
@jonny0_0 2 жыл бұрын
Really great explanation. I've been struggling to get my head around this for ages. I feel like understanding this has opened a big door for me. Cheers!
@CraigMitchell666
@CraigMitchell666 3 жыл бұрын
Great vid buddy! Keep 'em coming and thanks!
@John-cz7fo
@John-cz7fo 3 жыл бұрын
Nice tutorial! I'll have to check out your other videos
@KyriosRat
@KyriosRat Жыл бұрын
Great video, very good breakdown on communication through Blueprints.
@AriaRedux
@AriaRedux 2 жыл бұрын
Yes!!! Thank you so much. This solves sooo many things for me!! Great tutorial. Very well explained. I greatly appreciate the time you put into this.
@travelsimitaly2247
@travelsimitaly2247 3 жыл бұрын
oh man, this is the best wildcard tutorial i have seen so far, finally i have discovered the correct way, thanks! sub +1
@GDXR
@GDXR 3 жыл бұрын
Thanks for the sub!
@corgilife241
@corgilife241 Жыл бұрын
Very helpful and finally I get it!! Thanks!
@samuelmertens4116
@samuelmertens4116 11 ай бұрын
very nice tuto, i finally understood how to make a reference for casting. But there's a problem: I can't do it in my project... I don't find the parameter yyou selected at 7:11. In my project, that's not a light but a character ( a cube that follows the player). Is that a problem?
@samuelmertens4116
@samuelmertens4116 11 ай бұрын
ok, I forgot to put the variable as public.... and again, it's really the best casting tuto out there
@Chokwik
@Chokwik 2 жыл бұрын
thanks mate! really helpful tuto, very good examples
@richmind5867
@richmind5867 2 жыл бұрын
solid tutorial. much better details than other videos. do you have a video of just blueprint and step by step how to use it and why and how etc. thank you awesome video
@GDXR
@GDXR 2 жыл бұрын
Not yet!, but I plan on creating one soon.
@markguilard
@markguilard 3 жыл бұрын
Very interesting, thanks for your help, I had so big problems with the objet in cast. It was so confusing before
@blackivy011
@blackivy011 3 жыл бұрын
Awesome explanation thank you
@texmurph
@texmurph 3 жыл бұрын
This is great, thanks! One question - is there a downside to using Sequencer to control lots of actors at once? Like if I want a trigger to turn off 5 lights, turn on 2, etc, I'll trigger a level sequence since this lets me easily time audio to go along with it, etc. I can use that to trigger changes in the level as well - to have geometry shift up and down that are controlled by parent actors, etc. I've generally been told that it's better to code everything instead, though, but over time haven't had any issues using level sequences, so am curious.
@GDXR
@GDXR 3 жыл бұрын
Like normal it really depends on what your doing and the best aproach to it. From your description I'd also use sequencer but with interfaces so id give the actors an activate function/event and then use sequencer to fire them. This way you can make the re-usable and have other things active or fire them as well.
@heylesson6910
@heylesson6910 2 жыл бұрын
Thanks so much, you helped me figure out where I was slipping up. I was trying to cast to a Player_UI blueprint. But couldn't figure out what to put in the wildcard object pin. I tried assigning the variable I created to be an "Actor" like you did in the video but it didn't work for me. Then I realised: wait, my thing isn't a light, like this guy's - my thing is a widget. So instead of "Actor" as a variable type, I needed to use "User Widget" - since that is the parent class. If anyone else is having trouble, ask yourself: "what is the parent class of the object I'm trying to cast to?" If you go to your blueprint window, it will tell you in the top right corner! :)
@heylesson6910
@heylesson6910 2 жыл бұрын
spoke too soon i'm still stupid
@GDXR
@GDXR 2 жыл бұрын
hey lesson. I have a (Current) 2 part series working with UMG and blueprints covering communication. Might be worth checking those out as they should help you get started. kzbin.info/www/bejne/r5ase5t3qM56qdk
@hendrixgreengilmour
@hendrixgreengilmour Жыл бұрын
Thank you so much. Really appreciate this
@tahagungor9968
@tahagungor9968 3 жыл бұрын
The best tutorial on the topic, you should definitely fo kore tutorials, youre a natural talent in teaching
@GDXR
@GDXR 3 жыл бұрын
Thank you, I plan on doing more soon to cover similar topics.
@antoniopepe
@antoniopepe Жыл бұрын
Thanks for this deep explanation
@mohamadalkotob2525
@mohamadalkotob2525 2 жыл бұрын
amizing tutorial thx bro
@tedats
@tedats Жыл бұрын
Great tutorial. I'm scared I might actually get it. First try worked!
@SherrinVargheseofficial
@SherrinVargheseofficial 2 жыл бұрын
Thank you Sir.....................😍 I've struggled with this and how!!!
@danielgiambattistelli7380
@danielgiambattistelli7380 9 ай бұрын
one question. does the node DOES IMPLEMENT INTERFACE is of use in this case instead of the array?
@conkerthesquirrel4331
@conkerthesquirrel4331 2 жыл бұрын
Ty for explaining this! I literally had the same thought process with the wildcard. It constantly trips up my code because I didn't fully understand. Ty ty!
@OpenMawProductions
@OpenMawProductions Жыл бұрын
This is a great tutorial. I just wanted to ask a question because i'm having a problem. So i'm trying to create secret area actors. Essentially it's just a trigger box that adds a tally to the "secrets" and displays a message. That's all good. Problem i'm having is i'm trying to get this actor to, on Begin Play, report to the Widget that it exists to be added to the total count. So Event Begin Play - > Final all widgets of class W_MainHUD -> For Each Loop With Break -> On Complete call BPI "UISecret Add Total" In MainHUD I have Event Ui Secret Add Total... and it doesn't seem to register at all. I just had it setup with a simple print string to see if the message was going through, and it's not.
@GDXR
@GDXR Жыл бұрын
Hey, so first thing that comes to mind is the order actors are loading into the scene at. It sounds to me that your actors and find all widgets of class are firing event begin play before your vrpawn has created/loaded the Widget blueprint to display the infomation. you can see if this is the case by adding a delay of a second or two after the event begin play. Giving everything enough time to load in before firing the event in the HUD. If you are still having issues, drop by the discord and we can help debug some more.
@4ArtArtArtArt
@4ArtArtArtArt 2 ай бұрын
I enjoy learning from your videos. I'm willing to give you a "Mega Thank You" upgrade but I have one question. You have mentioned you need a VR headset for this tutorial. My question is do you think that my iPhone would work to Raytrace like the headset instead?..and if so could you tutor your patreons on that. I don't have a VR headset but I sure do want to make a VR game eventually.
@GDXR
@GDXR 2 ай бұрын
Hi, Sorry for the delay. But for this video you dont need a VR headset. The logic works for any and all projects. Unfortunatly i dont think an Iphone would work to fake a vr headset. Its also extremely difficult to build content for IOS as you require a Mac which i dont have.
@4ArtArtArtArt
@4ArtArtArtArt 2 ай бұрын
@@GDXR well thanks for the reply. Good to know. It be nice to have both wouldn't it ahah.. Hope you do someday. Thanks anyways.
@Nosferatu_tqegaming
@Nosferatu_tqegaming 9 ай бұрын
can you cast to a static mesh? from a blueprint actor or its function to a static mesh? ttying to get my component thats connected to my charcter to act like a BP actor
@itanshi
@itanshi 3 жыл бұрын
Suggestion for another video. When to use UMG Bindings and alternatives to them
@GDXR
@GDXR 3 жыл бұрын
Great suggestion!, but for now. Allways use bindings when the infomation on the hud will be updated or chaged. You can then create an interface "BPI_UMG" which contains all the events required for your hud. All you need to do then is pass the infomation through the event to the hud. Just make sure your interface message has the correct refrence.
@Nosferatu_tqegaming
@Nosferatu_tqegaming 9 ай бұрын
Love this video. Did something with some of these principles. Then wanted to apply it to a mesh component that is attached to my 3rd person character. Couldnt figure oit how to add the BP functions.. Do i need to create the same blueprint but drag the static mesh component into the 3rd person event graph and then created the BP string? If i use the BP object in the world it functions fine so would the method i explained work for replicating the function on the same object but that is attached to the 3rd person mesh? please reply! 😅😂
@SSHEINI82736
@SSHEINI82736 2 жыл бұрын
Great video, thank you very much!
@ili76767
@ili76767 2 жыл бұрын
To my confusion, since you have selected the light in the viewport with a dropper, why use casting? Wouldn't it be better to just directly communicate?
@zablade
@zablade Жыл бұрын
That's a public variable, which allows you to edit variables from outside the blueprint instance itself, like in the level editor. You could cast to things that are explicitly going to be loaded in the level, no matter what, like the player
@guillermo3dcode
@guillermo3dcode Жыл бұрын
Im the like numer 900 ! I appreciate the info, thanks a lot men ! ❤❤❤❤
@ibrews
@ibrews 3 жыл бұрын
Excellent video !!
@maliciouscompliance6489
@maliciouscompliance6489 Жыл бұрын
Excellent work!
@arvideo2145
@arvideo2145 2 жыл бұрын
I have never used blueprint interfaces but i have used Event Dispatchers. When should you use BPI instead of ED?
@pacocarrion7869
@pacocarrion7869 3 жыл бұрын
In my case doesn't work. I create a BluePrint (Actor), with a variable (Transform) and a mesh. The variable picks up the position of the mesh (WorldTransform) I create another BluePrint (Actor), I use Cast To, in the input of the Object dont work any variable (actor, object..doesnt care which one) does not recognize it. Something is missing in this tutorial or I don't undestand how is working Cas to :(
@GDXR
@GDXR 3 жыл бұрын
The wild card for your cast if the cast is correct "Cast to First Blueprint name" the wild card should be a variable of the type your first blueprint is so in variables search the name of the blueprint you created. From there you just need to reference the actor in the scene. If you need help with this, hop over to the Discord, you can then post some images and we will be able to help you out with it.
@pacocarrion7869
@pacocarrion7869 3 жыл бұрын
@@GDXR thanks GDXR, for the answer I fix the problem
@Noruzenchi86
@Noruzenchi86 3 жыл бұрын
So interfaces is basically sending an event to all (specified) actors supporting that interface. Can you tell them to change to a specific material via the triggering actor like you have the actors to be triggered array, rather than on the actor to be triggered?
@GDXR
@GDXR 3 жыл бұрын
Yeah, you would just have the envent set the material to the one you want. If i understand correctly.
@ChrisCohen
@ChrisCohen 2 жыл бұрын
That isn't what an interface does. I can see how the video would suggest that though because it's a bit misleading. I love all the comments saying "best teacher ever" from people who now totally misunderstand interfaces! An interface just defines a contract that must be obeyed by everything that implements it. If you have a "light" interface, you might decide that everything that implements it MUST be able to turn on and off. You could have a ceiling light, or a desk lamp, or anything, but if it implements the "light" interface, you can guarantee it can be turned on or off. Hence why a cast isn't required. The interface itself doesn't know anything about the things that have implemented it. You can't ask it for a list. But what you can do is ask the level to give you a list of all things that implement the "light" interface (try not to do this for performance reasons). Or provide your own list as in the video.
@RprtBak
@RprtBak 2 жыл бұрын
This is fantastic!
@DrSciencex
@DrSciencex 2 жыл бұрын
This was awesome! Ty!!
@dpnexus
@dpnexus 2 жыл бұрын
I'm in UE4, followed exactly. Cast still fails ? is this UE5 only? I create a new variable type BP_Light (same name as the light bp) then get the 'note' warning, I convert it to 'actor' type.. it compiles. Cast still fails? Help! lol thanks
@GDXR
@GDXR 2 жыл бұрын
if your getting a note warning its possibly your trying to cast to the actor your already inside of. The cast should be in another actor which is looking for the light.
@Lord_Volkner
@Lord_Volkner 3 жыл бұрын
Ok, so if we have a dozen instances of light_bp in the level and when overlapping we want to access a variable in one specific light. How would we cast to that specific light?
@capitainebejita753
@capitainebejita753 2 жыл бұрын
I can't convert the variable to an "Actor type" it stuck on loading & searching indexing in blueprint....
@N3DArtworks
@N3DArtworks 6 ай бұрын
Having so much fun learning UE that I don't even notice the sun coming up or going down to a point where I'm having problems with my BP. arghhh sleep,,,, why are you even a requirement!!!?
@alhusseinali
@alhusseinali Жыл бұрын
Dude!, you saved my life.
@llYuki0okami
@llYuki0okami 2 жыл бұрын
so Object Input in Cast To node is just asking us what instance we want to connect to, like we have Blueprint CAR, we put it to the level several times making several instances of it, when we Cast To Blueprint CAR unreal do not know with instance of it we wanna cast to.
@GDXR
@GDXR 2 жыл бұрын
Yeah, it needs to know exactly what instance its looking at for the cast to work.
@iSneakyPewPew
@iSneakyPewPew 2 жыл бұрын
Thank you! I've been struggling to understand BP Interfaces and this helped bridge a knowledge gap for me. After watching some other videos, I was under the impression that you could just make an Interface with a Function and any blueprint you attached that Interface INTO would communicate through that. Basically a broadcast from any trigger containing that function that any other Blueprint (that also had that interface added) would be listening for and reacting to. Please correct me if I'm wrong, but it appears that it works more like a network where any blueprint with the Interface added to it is on the network, and can basically cast to any other blueprint on that same network. For instance, a button on that network (has the interface added) will do whatever you program it to do within the confines of other blueprints added to that network, like gathering an array of other blueprints to send a signal to. You could add blueprints to the array that were not on that network (haven't added the interface to) but they wouldn't comply because they aren't listening. In short, by adding the Interface to a blueprint, your giving the blueprint the option to communicate with other blueprints on the network (Interface), but you still have to specify which, because it's not a broadcast?
@conception3509
@conception3509 2 жыл бұрын
Yes, I also expected it to broadcast the first time. But as you said you still have to input it. This can also be done based on proximity or by getting all actors of class or all actors with interface. You posted this comment a while ago so I guess youre already well on your way with interfaces. I wish you happy developing!
@marxmarjoneljovellano4091
@marxmarjoneljovellano4091 2 жыл бұрын
Could you make tutorial for soft object reference?
@GDXR
@GDXR 2 жыл бұрын
Epic Actually have an in-depth stream covering it so might as well learn it from the guys who make the engine lol. kzbin.info/www/bejne/gWGof6GCi5Zsedk
@rremnar
@rremnar Жыл бұрын
It's better to use a sequence than chain "what if's" together (Edit: For unrelated events).
@Xanex60
@Xanex60 2 жыл бұрын
TY so much !!!
@croxyg6
@croxyg6 7 ай бұрын
Losing my mind. All I want to do is pass a variable from a Pawn blueprint to an Actor blueprint. Both blueprints are dropped in the same Main scene. All of the the variables I want to pass are set to public. I have properly Set a Boolean Var in the Pawn BP, but when I try to Get that same Boolean Var (for example) inside the Actor BP, it requires a Target (self), which I cannot modify to point to Pawn's BP.
@croxyg6
@croxyg6 7 ай бұрын
I've set up a Blueprint Interface with an Input and Output Booleans. It is set up in the PawnBP after the Boolean is Set, and is also set up in the ActorBP but the variable will not pass.
@GDXR
@GDXR 7 ай бұрын
so the main issue here, is that the character is spawned after you press play so you can't set the reference. However, there are a couple ways of doing this. As you mentioned in your own reply. A blueprint interface is the best approach since you don't need to cast, however, you do need the target. Something you could do is do a search for "Get all actors of class" and run a for each loop from the array into the interface target. this will fire it in every actor you have in the scene if you have more than one. However, another approach is to have the actor cast to the player's pawn. From there the actor can just get the boolean variable. It's entirely up to you on the approach you take. If you aren't already, make sure to drop by the discord, it makes helping with questions like this much easier as screen shots can be shared.
@albertorossi282
@albertorossi282 Жыл бұрын
I love you so much you saved me so much time
@GDXR
@GDXR Жыл бұрын
And I love you, random citizen!
@DrekenProductions
@DrekenProductions 3 жыл бұрын
awesome tutorial
@arkalexx
@arkalexx 2 жыл бұрын
Thank you. very usefull.
@GDXR
@GDXR 2 жыл бұрын
You are welcome!
@kalamwahed6525
@kalamwahed6525 Жыл бұрын
I love it 👍🏽
@EtzeNuegez
@EtzeNuegez 2 жыл бұрын
thanks man, super helpful, also, i got 420th like lol
@nutchan1500
@nutchan1500 3 жыл бұрын
I have a question. How can I add more actor to the array while the game is running? Like if I spawn a new cube that I want it to have its Active interface function tie to the pre-existing collision box. Also this video is great!
@GDXR
@GDXR 3 жыл бұрын
Great question. of the top of my head on begin play you could cast or interface (If the refrence is correct) to the actor which contains the array. From there you just send the infomation through the cast node using an actor variable and then add it to the array. Check this video out to see how interfaces can send variable data. kzbin.info/www/bejne/pairfJWCd8aCpqM Hope it helps.
@nutchan1500
@nutchan1500 3 жыл бұрын
@@GDXR Thank you a lot. This is very helpful :D
@nightwalkerj
@nightwalkerj 2 жыл бұрын
So basically the "wild card" of a cast node is just referencing an actor already in the scene? If so, damn I wish someone would have said that sooner. Now it actually makes some sense.
@framex_media
@framex_media 8 ай бұрын
Brilliant, thanks
@arkalexx
@arkalexx Жыл бұрын
But if you put a sequence, you can run difference cast to no matter if the other run or not..
@SoloGameDeveloper
@SoloGameDeveloper 2 жыл бұрын
Thank you.
@dannyvelez6819
@dannyvelez6819 Жыл бұрын
i likes the tutorial i need a simpler one though i think im trying to learn how to use interfaced for the first time and this tutorial while well made is still very confusing to me .
@АлексНеВажно-х4г
@АлексНеВажно-х4г 2 жыл бұрын
Everywhere, everywhere they make casts for the actor who stands on the stage, BUT no one shows how to make casts for the actor who should appear later!
@50shadesofskittles9
@50shadesofskittles9 2 жыл бұрын
Great vid. Casting can get very expensive.
@TheChosenOne462
@TheChosenOne462 6 ай бұрын
thats not turing on the lights thats more like turning it off
@ericmatthews9894
@ericmatthews9894 2 жыл бұрын
Thank you for teaching and not "copy/paste what I do...what!? It didn't work!?...I don't know, sorry" like so many other tutorials.
@skysoftware4581
@skysoftware4581 3 жыл бұрын
Can you upload 1080p as 480 is unreadable
@GDXR
@GDXR 3 жыл бұрын
This video is 1080p id recommend checking the settings on your end.
@bart-kay
@bart-kay 2 жыл бұрын
There is NO GODDAMN 'Blueprints' Folder in my project. Why cant you people who make these videos start at the beginning, and give us ALL the instructions step by step?
@GDXR
@GDXR 2 жыл бұрын
Erm, this is the beginning. It's the default third person template. If your not using it then that would be why there isn't a blueprints folder. You can easily create one though or create a new project using the third person template.
@eddebrock
@eddebrock 2 жыл бұрын
This made no sense.
@JohnRiversOfficial
@JohnRiversOfficial Жыл бұрын
how can i have one collision sphere look only for meshes and not other collision spheres that is part of the mesh - and furthermore, do it actor-specifically, and not just look at primitive meshes
Unreal Engine - Casting and Interfaces Explained
21:31
Reids Channel
Рет қаралды 32 М.
Blueprint Interfaces | Unreal Engine 5 Tutorial
14:41
Tyler Serino
Рет қаралды 61 М.
My scorpion was taken away from me 😢
00:55
TyphoonFast 5
Рет қаралды 2,7 МЛН
Enceinte et en Bazard: Les Chroniques du Nettoyage ! 🚽✨
00:21
Two More French
Рет қаралды 42 МЛН
PLEASE just use CASTING
14:18
The Game Dev Cave
Рет қаралды 11 М.
I Struggled With Blueprint Interfaces for Years!! (Unreal Engine 5)
16:48
Glass Hand Studios
Рет қаралды 194 М.
Blueprints vs. C++: How They Fit Together and Why You Should Use Both
47:14
Need to Know Nodes in Unreal 5 Blueprints
48:59
Cason Quisenberry
Рет қаралды 93 М.
PCG: First Steps to Advanced Development | Unreal Fest 2024
51:04
Unreal Engine
Рет қаралды 56 М.
Stop Casting! use blueprint Interfaces Instead!
11:56
The Game Dev Cave
Рет қаралды 14 М.
Lighting in Unreal Engine 5 for Beginners
44:44
William Faucher
Рет қаралды 1,1 МЛН