Oops sorry… I said it wrong it was not spawn actor
How it works is that I load a level instance
And in that level is a blueprint amongst the other items
so I cant just spawn it there because its in that level
In the return value node you can promote to variable . this way if its in the game mode(for instance) you can always access that class via the game mode. For instance spawning a hud or widget and then you promote it to a variable when next you want to add it to viewport you don’t need to use crate widget but simply get that variable and then add it to viewport. Hope this helped. Let me know if my description wasn’t clear enough on . Hope this helped
If it’s spawned dynamically by the LB, you already have the reference (return value) and there’s nothing to cast… It’s an actor with the correct type already.
So what exactly are you trying to do.
I want to access some variables,
The LB needs to know variables of the actor, sure - right click the Return Value pin and promote to variable - that’s the hard actor reference now. You can use it as is, no need to cast.
All what’s needed is to access and
change the root Data so that the
instances will inherit that Data
Not sure what that means. What’s root data? Class Default?
But I feel I’m missing the point. Consider describing the end result. No idea why the question is about casting in the first place, there’s no casting needed here.
The Thing is I want to access the
variable that has the speed rate so as
you go on the speed increases
Is this like a power up that the player runs into? Or an effect of that entire level? So there’s an actor in the level and this actor needs to send the data to who, the player? Or to some other actors - are those actors in this level? This is so confusing.
So What’s needed is to change the
original actor’s property so that the
instances will inherit from that
original actor
I don’t get it, sorry.
The Thing is I want to access the
variable that has the speed rate so as
you go on the speed increases
But again, who needs to access that variable, the player?!
To keep it simple, every blueprint class when being spawned can be promoted to a variable even widgets. I do what your describing by promoting what is spawned to a variable(object reference variable). This way if it was spawned through the game mode or instance (preferably game instance so it is accessible in all levels till you restart your app) you just need to cast to game instance , then get the variable(of spawned object ex character), then from that you can get your value. I’ll add a screenshot that i feel is the simplest implementation of this. I add my HUDs through my game mode and whenever i want to access their variables on whatever level i am i just call it from there.