Тёмный
No video :(

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

GDXR
Подписаться 13 тыс.
Просмотров 49 тыс.
50% 1

Updated Discord invitation: / discord #UnrealEngine #VR #VirtualReality
► Join the Discord: / discord
► Description
Hey everyone, I struggled a lot when starting out with Blueprints especially with blueprint communication and I naturally ended up using cast nodes. So I thought id show you how to use them as well as why blueprint interfaces are actually better in the long haul. So I really hope you all enjoy it.
In-depth Interface tutorial: • Using Blueprint Interf...
-----------------------------------------------------------------------------------------------------------
► Patreon: / gamedevxr
► Twitter: / gamedevxr
► Instagram: / gamedevxr
-----------------------------------------------------------------------------------------------------------
If you're new to VR and want to get started with Oculus Quest development, I recommend watching these videos first.
1. Installing UE4 from Source code (contains more up to date Quest features)
• Installing UE4 4.25 fr...
2. Installing Android Studio (Required to create Oculus Quest projects in UE4.25+)
• Installing Android Stu...
3. My Oculus Quest 1 Settings (These are different to the Quest 2)
• My Oculus Quest 4.25 B...
4. My Oculus Quest 2 Settings
• Quest 2 Settings You S...
-----------------------------------------------------------------------------------------------------------
PC SPECS:
► RTX 2070 Super
► I9-9900K
► 32GB Ram
► 2TB SSD
Equipment
► Keyboard: HyperX Alloy Origins
► Mouse: Anker® Ergonomic Optical USB Wired Vertical Mouse
► Mic: Trust GXT 232
► WebCam: Jelly Comb
► Screen: AOC I2367fh 23-inch LED x 2
► Headset 1: Oculus Quest 128GB
► Headset 2: Oculus Rift + Motion Controllers
► Headset 2: Oculus Quest 2
► Graphics Tablet: Wacom Cintiq 13hd

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

 

28 авг 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 145   
@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 :)
@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 :)
@shaneruetz5604
@shaneruetz5604 2 года назад
Can confirm, this used to drive me nuts, to the point where I would avoid casting all together haha. Good video!
@mrorange159
@mrorange159 5 месяцев назад
This is by far one of the most logical and straight forward tutorials I've come across that explains casting. Thanks very much!
@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!
@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.
@ecoclasico
@ecoclasico Год назад
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
@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 !!!
@steveg7292
@steveg7292 11 месяцев назад
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.
@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.
@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.
@Switch620
@Switch620 Год назад
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 11 месяцев назад
This comment is underrated. The description of casting in the video is going to be quite misleading for newcomers
@danielgiambattistelli7380
@danielgiambattistelli7380 5 месяцев назад
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.
@kyoai
@kyoai 2 года назад
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.
@kalewhite111
@kalewhite111 Год назад
I was looking for a decent explanation of casting for so long. Thank you.
@chagaze7199
@chagaze7199 2 года назад
confirmed, it HELPED! Thanks a lot !!
@DesertStormXQ
@DesertStormXQ 2 года назад
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 2 года назад
Your welcome, super pleased it was helpful.
@X400DYL
@X400DYL Год назад
WOW great Tutorial, Made total sence and well explained, Thanks Subbed
@GDXR
@GDXR Год назад
Thanks for the sub!
@bamfyu
@bamfyu Год назад
This was really helpful. Thank you.
@adityasingh270
@adityasingh270 2 года назад
Thanks man was searching for a video like this for months.
@CGDive
@CGDive Год назад
This is very well explained and useful. Thank you!
@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!
@dreambadger
@dreambadger Год назад
Thanks for video. I'm currently learning about interfaces & components and i've watched a few of your videos today.
@MatyasCensky
@MatyasCensky 4 месяца назад
Very well explained, great examples. Thanks
@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.
@lasereye159
@lasereye159 2 года назад
Dude, i have to thank you. Very clear explanation, good speed.
@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?
@KyriosRat
@KyriosRat Год назад
Great video, very good breakdown on communication through Blueprints.
@travelsimitaly2247
@travelsimitaly2247 2 года назад
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 2 года назад
Thanks for the sub!
@tedats
@tedats 8 месяцев назад
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!!!
@corgilife241
@corgilife241 Год назад
Very helpful and finally I get it!! Thanks!
@antoniopepe
@antoniopepe Год назад
Thanks for this deep explanation
@mohamadalkotob2525
@mohamadalkotob2525 Год назад
amizing tutorial thx bro
@CraigMitchell666
@CraigMitchell666 3 года назад
Great vid buddy! Keep 'em coming and thanks!
@tahagungor9968
@tahagungor9968 2 года назад
The best tutorial on the topic, you should definitely fo kore tutorials, youre a natural talent in teaching
@GDXR
@GDXR 2 года назад
Thank you, I plan on doing more soon to cover similar topics.
@hendrixgreengilmour
@hendrixgreengilmour Год назад
Thank you so much. Really appreciate this
@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. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-yeIJhAsiGsw.html
@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.
@markguilard
@markguilard 2 года назад
Very interesting, thanks for your help, I had so big problems with the objet in cast. It was so confusing before
@Xanex60
@Xanex60 2 года назад
TY so much !!!
@John-cz7fo
@John-cz7fo 2 года назад
Nice tutorial! I'll have to check out your other videos
@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.
@SoloGameDeveloper
@SoloGameDeveloper 2 года назад
Thank you.
@SSHEINI82736
@SSHEINI82736 2 года назад
Great video, thank you very much!
@blackivy011
@blackivy011 2 года назад
Awesome explanation thank you
@kalamwahed6525
@kalamwahed6525 Год назад
I love it 👍🏽
@maliciouscompliance6489
@maliciouscompliance6489 11 месяцев назад
Excellent work!
@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!
@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.
@alhusseinali
@alhusseinali Год назад
Dude!, you saved my life.
@Chokwik
@Chokwik 2 года назад
thanks mate! really helpful tuto, very good examples
@RprtBak
@RprtBak 2 года назад
This is fantastic!
@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.
@ibrews
@ibrews 3 года назад
Excellent video !!
@framex_media
@framex_media 4 месяца назад
Brilliant, thanks
@JPN767
@JPN767 2 месяца назад
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!!!?
@guillermofleitaspulido
@guillermofleitaspulido Год назад
Im the like numer 900 ! I appreciate the info, thanks a lot men ! ❤❤❤❤
@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 Год назад
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!
@drekenproductions
@drekenproductions 2 года назад
awesome tutorial
@albertorossi282
@albertorossi282 Год назад
I love you so much you saved me so much time
@GDXR
@GDXR Год назад
And I love you, random citizen!
@rremnar
@rremnar Год назад
It's better to use a sequence than chain "what if's" together (Edit: For unrelated events).
@DrSciencex
@DrSciencex 2 года назад
This was awesome! Ty!!
@arkalexx
@arkalexx 2 года назад
Thank you. very usefull.
@GDXR
@GDXR 2 года назад
You are welcome!
@Nosferatu_tqegaming
@Nosferatu_tqegaming 5 месяцев назад
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! 😅😂
@capitainebejita753
@capitainebejita753 2 года назад
I can't convert the variable to an "Actor type" it stuck on loading & searching indexing in blueprint....
@danielgiambattistelli7380
@danielgiambattistelli7380 5 месяцев назад
one question. does the node DOES IMPLEMENT INTERFACE is of use in this case instead of the array?
@arkalexx
@arkalexx 10 месяцев назад
But if you put a sequence, you can run difference cast to no matter if the other run or not..
@samuelmertens4116
@samuelmertens4116 7 месяцев назад
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 7 месяцев назад
ok, I forgot to put the variable as public.... and again, it's really the best casting tuto out there
@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.
@Nosferatu_tqegaming
@Nosferatu_tqegaming 5 месяцев назад
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
@nightwalkerj
@nightwalkerj Год назад
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.
@EtzeNuegez
@EtzeNuegez 2 года назад
thanks man, super helpful, also, i got 420th like lol
@ili76767
@ili76767 Год назад
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
@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 .
@arvideo2145
@arvideo2145 2 года назад
I have never used blueprint interfaces but i have used Event Dispatchers. When should you use BPI instead of ED?
@Lord_Volkner
@Lord_Volkner 2 года назад
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?
@pacocarrion7869
@pacocarrion7869 2 года назад
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 2 года назад
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 2 года назад
@@GDXR thanks GDXR, for the answer I fix the problem
@Noruzenchi86
@Noruzenchi86 2 года назад
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 2 года назад
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.
@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. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-K0ENnLV19Cw.html
@llYuki0okami
@llYuki0okami Год назад
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 Год назад
Yeah, it needs to know exactly what instance its looking at for the cast to work.
@croxyg6
@croxyg6 3 месяца назад
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 3 месяца назад
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 3 месяца назад
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.
@user-zq9gq5nr6o
@user-zq9gq5nr6o 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!
@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.
@50shadesofskittles9
@50shadesofskittles9 2 года назад
Great vid. Casting can get very expensive.
@TheChosenOne462
@TheChosenOne462 2 месяца назад
thats not turing on the lights thats more like turning it off
@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. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-owHKbLBaOpA.html Hope it helps.
@nutchan1500
@nutchan1500 2 года назад
@@GDXR Thank you a lot. This is very helpful :D
@ericmatthews9894
@ericmatthews9894 Год назад
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 2 года назад
Can you upload 1080p as 480 is unreadable
@GDXR
@GDXR 2 года назад
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
Далее
Why Solo Developers Should Use Unreal
10:55
Просмотров 366 тыс.
娜美这是在浪费食物 #路飞#海贼王
00:20
🎙ПОЮ ВЖИВУЮ!
3:17:56
Просмотров 1,5 млн
what will you choose? #tiktok
00:14
Просмотров 6 млн
Stop Casting! use blueprint Interfaces Instead!
11:56
Event Dispatchers | Unreal Engine 5 Tutorial
19:09
Просмотров 31 тыс.
Someone Made Pay 2 Win: The Game And Its Hilarious
14:11
Unreal 5 Secrets Every Filmmaker Must Know
15:04
Просмотров 208 тыс.