i want to make a 3d main menu with if you press a button you go to that place.
but i cant find out how to go from camera to camera when you press a button.
I suggest using SetViewTargetWithBlend
, here’s a silly example of switching between 2 cameras on key press:
(you should be able to do something similar in your widget blueprint)
i dont really understand becasue i cant get the camera actor refrence ui blueprinth i have made someting that works a litle instad of it goin to the next camera it goes to 0, 0, 0 so maybe i can fix that to make it work
My screenshot was just an example, you don’t need to reference it the same way.
Here’s something more appropriate for your use case:
- Add a camera actor to the scene.
- Add a tag to the camera actor (see image), I called it “ExampleTag”, you can call it however you want:
- Add the following two nodes (see image) to your graph, and fill in the same tag you set on your camera actor:
where do i need to add the nodes?
Before SetViewTargetWithBlend
, these nodes (the blue wire coming from GET) will get you the “New View Target” parameter for SetViewTargetWithBlend
.
if i do it like this i get an error message
im i still doing it wrong or
(sorry its my second try to making a game so i dont know much yet)
GetAllActorsOfClassWithTag
needs the white execution wire as input. Connect the white wire from “Then 1” (on Sequence) into GetAllActorsOfClassWithTag
.
Related, please go through this to figure out the essentials, otherwise you’ll be completely lost. Basic Scripting with Blueprints in Unreal Engine | Unreal Engine 5.6 Documentation | Epic Developer Community
Yes, a bit messy, but this should work. Now you just need to add a camera actor to the level and give it the “Quittag” tag as I explained above.
thank you so much your the best
do you also know how to make it smooth or not?
Modify the parameters on SetViewTargetWithBlend
to change the way the camera is switched. By default it just snaps, but you can make it slowly move in.
wich ones?
Any. Mess with them and see what happens.
You’ll have to fiddle with a lot of things yourself to make any project, there is no answer to give you here. It’s based on what you want to do.
i meant more like what are the parmanters
i already tried that but if i cnage anythingi wont do anything it still wont go smooth to the other camera it will just take longer
nvm
it worked now for some reason
hi so i made the main menu and thank you again for your help but when i press to load a new game it just wont load i just used the load level by name.
and if i press to play it will still load the directenol light so i think maybe its just the players view still being at the camera what makes it load but i cant find a way to stop the player viewing trough the camera.
It’s very hard to say what went wrong just based on this screenshot, the yellow warning about the lights shouldn’t have anything with preventing your level loading. Here are a few things to try:
- After pressing the button, open the Output Log and see if any other errors/warnings pop up.
- Make sure your level is actually named “start”.
- Connect the red “Out Success” wire to a Print node to see if the loading succeeded or not.
- After pressing the button, try pressing F8 to fly around the level with free camera, this should make it very obvious if your new level is loaded or if you’re still on the old level.