So I’m trying to add a transitional camera that moves between my separate cameras, to blend between each camera mode (TP, TPS, FPS). Instead of getting an instant/hard snap to the next camera setup like I had before (Which looks a bit ugly in my opinion, so I wanted to spruce it up a bit).
I tried using vinterpto in a while loop, but it crashes each time I try to switch cameras. So if anyone can help me out with this, I’d appreciate it. Here’s a picture of my setup where it’s causing issues:
I’m assuming I’m making a rookie/beginner mistake, so hopefully it’s an easy tweak/fix
Your problem is that you’re using a function, which is blocking execution until it’s complete, so your loop becomes infinite (Because delta time never changes and thus, VInterpTo doesn’t progress). You need to put it in your event graph or a macro.
Actually, you shouldn’t use a loop at all, but do one processing on each Tick.
Oh, ok! Just did some research into Functions and Macros and this makes a bit more sense. Just curious though, if I put this into a macro would it work as part of a function? I say this as my camera setup right now is mostly done within a function I created, so would a macro work inside this function or would the above issue still occur? I just want to know if I need to completely reorganize/change my setup for this. Thanks again for your help
The blueprint ‘Set view target with blend’ node does exactly what you want. Keep it mind that you can’t specify a camera directly, but have to provide an Actor that itself has a CameraComponent to use. A bit inconvenient, but so far I couldn’t find a better way.
Update:
The reason I want to use a while loop is because there are different things that need to happen after the loop completes depending on other information. If I were to circumvent the WhileLoop node and use EventTick, as suggested here, I would have to add a bunch of extra variables, branches, and safeguards to make sure everything happens in the correct order. With the way I have it now, it’s all in a function (can be in a macro, doesn’t matter, the while loop as it is now still acts as “a big fat crash button”) that only flows in one direction.
If it can somehow be made so the while loop doesn’t halt all other operations, then this wouldn’t be an issue. I’m not trying to say everything would be magically fixed, but why is it that when someone wants to use a while loop, the only suggestion is DONT DO IT?! lol.