How to set my variable true?

Hey,

I want to change my camera to another position. That´s working if I only have to press “3” for example.
But If I set a variable in this event graph, it doesnt work.

The first image is from my actorblueprint and the second of my level blueprint. Maybe I have to connect them better. I hope you can help me. If there are any questions just ask.

greetings

Hello Shmann! There are a few problems here. Firstly, the Branch in your level blueprint doesn’t have an executing line going into it, so your logic never even makes it to the branch. Second, Changing a variable in one blueprint will not effect another blueprint unless you use Casting to communicate. Also, you cannot change level blueprint variables from other blueprints unless you dig down into some C++. But level blueprints can change variables in all other blueprints.

Check out these short tuts on casting:

- YouTube

I hope that helps. Casting is kind of tricky to wrap your head around, but once you understand how it works it makes everything else much easier. Good luck!

Thanks for your reply. the video helped a bit. My camera change now if I enter my location, but the camera is on the wrong position and still follow my character. so how can I (maybe deactivate character camera and) change the camera to the right location?

Other question to your reply: You said I cant change variables from level blueprint in other blueprints, but my variable is from a normal blueprint and I want to change it in my level blueprint. So it should work or did I missunderstand something?

Greetings

Correct, you can change your camera blueprint’s variables from the level blueprint using casting.

I am not sure what you are asking in the top question. Could you post another image of the blueprint with more visible?

Ok, sorry for my bad english btw. :smiley:

I try to explain it:

I want to change my camera of my character to another camera If I press F in a collision zone.

I tried to realize it like this:

This is my collision zone:

and this is my new camera target:

I tried to set a valiable in my pooltableblueprint to true if I press F with this:

and this is my try to change the camera to another if my valiable is true:

The camera change successfully If I delete the branch and the valiable and replace it with “press 3” for example.
So the problem should be that my valiable is wrong or couldnt be read by the level blueprint (I´m really new to UE4 and gameengines general. I tried to change my camera for the last two days and didnt get it)

I hope you could understand me now and I didnt forget something >.<

Greetings

Your branch still doesn’t have anything attached to its in execution pin. You are using the right node after that, set view target with blend.

Where is that Pool An variable in the last image coming from? It doesn’t show any variables on the left, and it isn’t sourced from something else.

I did set a “tick event” as execution for the branch that it checks every frame if it´s true or not but If I do that I need a source for the variable and I dont know what I can connect there.
The variable is from pooltable and I got it as I deactivated “context sensitive” in the window for all actions.
Is the idea with “tick event” good? and what do I have normally as source for the variable or how can I connect this variable right from my collision box to my levelblueprint?

ty again for reply^^

Alright, I think this is what you want, this is the logic you need in your blueprint. But instead of searching for this every tick you should use OnOverlap.

Full Res: http://i.imgur.com/0ttXvk5.jpg

Not the most efficient way to do it, but it should give you the effect you want.

Perfect! It works! But only with Event Tick and not with Overlap but… THANKS A LOT! :smiley: You helped me a lot!

Btw: I dont need to cast to the Blueprint. It gives me a warning and as I delete it it worked also well.

Awesome, please accept the answer to help others in the future.