I watched all tutorials, tappy chicken blueprint and i still dont get it.
I have class blueprint with some triggers. When you overlay trigger it increase value in variable for 1. I get that. That works. But when i set on world many instances of that class, each trigger is for himself. Since its different instance of class. How can i take value from class variable and store that value inside level bluperints variable?
Hello there, unfortunately I haven’t found an easy way of doing what you’re after.
However, this is how I went about to solve the issue:
Class blueprint:
http://imageupper.com/s04/1/8/Q1397666813641655_1.png
Level blueprint:
http://imageupper.com/s03/1/6/X1397665824645075_1.png
Hope it helps!
Edit:
In your case you might want the sum of all the incremented integers and then print it from the Level Blueprint,
this is how I’d do it:
Class blueprint:
http://imageupper.com/s02/1/9/Z139766763364477_1.png
Level blueprint: http://imageupper.com/s04/1/4/M139766829164608_1.png
Hi wmbuRn,
Say you have a variable on your class Blueprint like “ClassVar” here:
Well, you can pull that variable out of a specific instance in the Level Blueprint like this:
To get the instance node (the one in the lower left with the text “from Persistent Level”), select the object you have placed in the level editor and then right-click in your Level Blueprint. You should now see an “Add Reference to…” option (in my case it’s: “Add Reference to BP_MyClassBP Instance”, “BP_MyClassBP Instance” is the name I gave my object in the level). This node represents one specific instance of your Class Blueprint (the one you had selected).
Hope this helps and sends you on the right path!
What you showed here is how to get One specific object from the Level, however, he stated that he has more than one instance in his level and that each of those needs to set a variable in the Level Blueprint.
How’d you go about solving that issue ?
Why don’t you create a custom event that has the variable type you need as an input.
In the Level Blueprint received the event and set the variable from it.
In the Trigger Event Graphs, call the event and pass in the variable you want to.
In that case, I’d do what you showed below (using a GetAllActorsOfClass node).
Yeah i want incremental integer in level bluperint. Problem is i dont have Cast To function. I even checked other questions but simply there is no cast To function -.-
I dont know how to do that, as i stated in my question
On the level blueprint event graph Right click, custom event. Then on its detail tab set the input type and name it what you want. Name the event what you want, then in your triggers call the custom event you just made. At least I think that will work. There may be done documentation on custom events.
Calling an event seems the best way to me, if it works. I’m going off UDK knowledge but I think it works the same. It should. If you had to have a reference to the object to call on it would be a function not an event.
Thanks so much . I had the same issue and spent several hours searching for answers. You are my hero.