🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

What is Casting with simple words?

Started by
2 comments, last by Crocodile99 3 years, 5 months ago

Hello. I'm new to the forum and a noob. I started learning unreal engine and currently i try to learn to use blueprints.

I have some difficulty understanding what casting really means and why we need it. I kind of understand but not really. Could you make it a little simpler for me to understand? I'm sorry for my noobness. This forum seems like a very good place to learn.

Advertisement

Crocodile99 said:
what casting really means and why we need it

for example: if u have Player A that has a bike, and u also have Player B that has a watch;

if in the code somewhere u have Player X but u don't know if X is A or B (so u don't know if X has a bike or a watch) then you Cast X To A and if the cast worked then X has a bike and u could change the bike colour -hurrah!-, but if the cast to A didn't work and u cast to B and that works, then X has a watch and u can tell what time it is -ole!-

https://docs.unrealengine.com/en-US/ProgrammingAndScripting/Blueprints/UserGuide/CastNodes/index.html​

Crocodile99 said:
I'm sorry for my noobness

noobness apology accepted ?

@ddlox This was very simple and useful! ?

Thank you very much! I checked what the documentation says about this and it's actually very good writen. I'm going to use the doc more often from now on. I'm sure that i'll get it completely now if i read about it some times, thanks to your simple explanation.

Have a good year!

This topic is closed to new replies.

Advertisement