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!
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
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 :)
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 :)
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.
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.
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!
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.
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
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.
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.
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.
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.
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!
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?
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.
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.
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...".
@@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.
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!
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?
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.
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.
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!
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.
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.
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
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! 😅😂
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.
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! :)
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. ua-cam.com/video/yeIJhAsiGsw/v-deo.html
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
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?
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.
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.
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.
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?
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!
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!
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. ua-cam.com/video/owHKbLBaOpA/v-deo.html Hope it helps.
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!!!?
Epic Actually have an in-depth stream covering it so might as well learn it from the guys who make the engine lol. ua-cam.com/video/K0ENnLV19Cw/v-deo.html
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?
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?
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
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 :(
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.
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
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.
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.
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.
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.
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.
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 .
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.
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!
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?
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.
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
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!
Thank you for posting this. It should be extremely helpful for those wanting more information.
@@GDXR agreed
Absolutely love how clear this description is A+
Lifesaver information here! thank you very much!!!
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
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 :)
Casting has been so confusing, two months in to learning UE5. This is a game changer lol, thanks so much!
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!
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 :)
Can confirm, this used to drive me nuts, to the point where I would avoid casting all together haha. Good video!
I'm newbie in UE, love to learn with you, it's easy to understand .Thanks You
This is by far one of the most logical and straight forward tutorials I've come across that explains casting. Thanks very much!
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.
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.
Interfaces rule !!!
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!
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.
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
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.
This comment is underrated.
The description of casting in the video is going to be quite misleading for newcomers
this helping me so much to understand what actually happen with that blueprint, thankyou so much Jonathan!
Thats awesome, I'm really glad it was helpful.
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.
I was looking for a decent explanation of casting for so long. Thank you.
Thanks man was searching for a video like this for months.
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.
What?
Thanks for video. I'm currently learning about interfaces & components and i've watched a few of your videos today.
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
Your welcome, super pleased it was helpful.
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.
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!
This is very well explained and useful. Thank you!
Dude, i have to thank you. Very clear explanation, good speed.
This was really helpful. Thank you.
confirmed, it HELPED! Thanks a lot !!
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?
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.
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.
WOW great Tutorial, Made total sence and well explained, Thanks Subbed
Thanks for the sub!
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...".
@@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.
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.
Very well explained, great examples. Thanks
Great video, very good breakdown on communication through Blueprints.
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!
Great vid buddy! Keep 'em coming and thanks!
Nice tutorial! I'll have to check out your other videos
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?
ok, I forgot to put the variable as public.... and again, it's really the best casting tuto out there
oh man, this is the best wildcard tutorial i have seen so far, finally i have discovered the correct way, thanks! sub +1
Thanks for the sub!
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.
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.
Very helpful and finally I get it!! Thanks!
Thank you Sir.....................😍 I've struggled with this and how!!!
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!
Excellent work!
The best tutorial on the topic, you should definitely fo kore tutorials, youre a natural talent in teaching
Thank you, I plan on doing more soon to cover similar topics.
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.
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.
@@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.
Very interesting, thanks for your help, I had so big problems with the objet in cast. It was so confusing before
This is fantastic!
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
Not yet!, but I plan on creating one soon.
Thanks for this deep explanation
Excellent video !!
Awesome explanation thank you
amizing tutorial thx bro
thanks mate! really helpful tuto, very good examples
Thank you so much. Really appreciate this
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! 😅😂
Great tutorial. I'm scared I might actually get it. First try worked!
Suggestion for another video. When to use UMG Bindings and alternatives to them
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.
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! :)
spoke too soon i'm still stupid
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.
ua-cam.com/video/yeIJhAsiGsw/v-deo.html
I love it 👍🏽
Great video, thank you very much!
Im the like numer 900 ! I appreciate the info, thanks a lot men ! ❤❤❤❤
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
This was awesome! Ty!!
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?
Yeah, you would just have the envent set the material to the one you want. If i understand correctly.
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.
one question. does the node DOES IMPLEMENT INTERFACE is of use in this case instead of the array?
Dude!, you saved my life.
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.
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.
TY so much !!!
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?
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!
I have never used blueprint interfaces but i have used Event Dispatchers. When should you use BPI instead of ED?
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!
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.
ua-cam.com/video/owHKbLBaOpA/v-deo.html
Hope it helps.
@@GDXR Thank you a lot. This is very helpful :D
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!!!?
Could you make tutorial for soft object reference?
Epic Actually have an in-depth stream covering it so might as well learn it from the guys who make the engine lol. ua-cam.com/video/K0ENnLV19Cw/v-deo.html
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?
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?
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
I love you so much you saved me so much time
And I love you, random citizen!
I can't convert the variable to an "Actor type" it stuck on loading & searching indexing in blueprint....
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 :(
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.
@@GDXR thanks GDXR, for the answer I fix the problem
awesome tutorial
It's better to use a sequence than chain "what if's" together (Edit: For unrelated events).
Brilliant, thanks
But if you put a sequence, you can run difference cast to no matter if the other run or not..
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
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.
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.
Yeah, it needs to know exactly what instance its looking at for the cast to work.
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.
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.
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.
Thank you.
Thank you. very usefull.
You are welcome!
thanks man, super helpful, also, i got 420th like lol
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 .
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.
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!
Great vid. Casting can get very expensive.
Can you upload 1080p as 480 is unreadable
This video is 1080p id recommend checking the settings on your end.
thats not turing on the lights thats more like turning it off
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.
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?
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.
This made no sense.
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