I’m looking to visualize an Apollo launch. I want the camera to follow a mutlti-stage rocket, but then a stage will separate, and I want the camera to then follow the other stages that are still moving, then another separation, etc. I want to keep the powered stages centered in the camera view (i.e., the spent stage will “fall” out of view), so I’d like either the camera to inherit translation data from stage 1, then stage 2, then stage 3 or find the mid point between all the active objects and follow that? Any ideas?
To get this to work quickly I’d try giving the different “stages” Scene components (for transform data) attached to the meshes (so they move with them) and are perfectly pre-located so the camera sees all it has to see, then when the stage changes you move the camera to the next Scene component with smooth LERP movement.
Something like that would be the simplest way I guess.
I’m not sure what you mean by new Scene components…like GetTransform on the mesh transform node that has the animation data? I’m new to UE4, so I may not grasp the obvious on some things. I do get what you’re saying with the LERP function to transition the camera.
I was thinking about setting up an additional channel in the stage animation to begin the LERP between the positions…that way if I chance the animations I could just adjust that channel instead of redoing trigger boxes.
Lets assume your ship is seperated into 3 parts. they are one above each other. Z would be the up and down location of the pieces. Make 2 cameras, one for the middle piece and one for the top piece. The default camera would be the one on the middle piece. now when the lowest piece detaches, the camera does nothing. When the middle piece detaches, set the current camera to the one attached to the one on the top piece. now the screen will show the top piece while the one with the previous camera centered on it falls off. There ya go, your problem is fixed.
so instead of doing complicated stuff to switch camera translation, rotation and etc you would just have 2 cameras that alter with a simple 3-4 blocks big code triggered by the event that makes the piece falls.
Of course using mutliple cameras works, but you would jump from one view to another without smooth transitioning.
I don’t think my approach is very complicated, I just thought a lerp motion would be nice when refocusing to the next camera position
If you go into the viewport editor of a component you can attach a “scene” component to your blueprint.
It’s basically an empty container that doesn’t get rendered. You can position them relative to the single parts of your rocket and locate them where you would want to have the camera positioned in the end.
You can use the position of these so you don’t have to do as much calculation as the scene components move with the parts and you only have to lerp towards them.
Are the parts themselves moving pieces or is the whole thing just “moving” through animation?
If so, you might have to attach the scene components to bones instead of the mesh pieces (as you probably wouldn’t have any pieces you could selectively attach to).
BladeDev’s answer would be a simpler approach where you preposition the cameras instead of scene components and just switch the view to the next camera (which would happen instantly, without a smooth transition). To do that you’d just have to deactive the first camera and active the second and it should switch.
Each part has its own animation. I like the idea of the smoother transition vs. the jump cuts, but both are viable. How do I attach the scene to the bone? I’m still getting use to blueprints, and there’s a lot of options that seem to change according to what I have selected. Thanks to everyone for the help!
In the top left you can add scene components to your blueprint. You just drag and drop them to be attached to the single parts of the rocket like you can see in the components menu on the left (I added in cameras so you can see the scene positions in the viewport).
Position them accordingly, then from the Eventh Graph, you can get the location of each scene and move the camera to it.
That helps some. The problem I have is that I’m using a skeleton then the rocket pieces are attached/bound to the skeletal bones. It helps to keep everything together and if I make a change, I think I can drop it into the same blueprint and it’ll be ready to go. Anyway, this doesn’t expose the individual parts of the rocket, just the overall skeleton in the Components tab. Is there a way to expose the skeletal nodes and then I can attach the scenes and cameras to those? I know it seems like I’m making this complicated, but as I move through this process, I’ve made a few changes to make my life easier in the coming months instead of having to remake a bunch of little rocket parts and import them everytime, I can make the changes and then do the one import into the Blueprint.
I am not quite sure if I understand your setup correctly.
Could you maybe provide screenshots so I can see how the blueprint and the skeleton works together and how the parts are combined.
So this is the skeletal hierarchy. I have an Actor Blueprint with the Mesh in it and an Animation Blueprint to provide the animation to the skeleton.
I tried to connect use one of the nodes of the skeleton (3rd stage) to attach the camera to, but it didn’t work…at least not how I have it, but like I said, I’m still getting my head wrapped around this. My background is a lot of work with Maya.
So then I thought if I could just cast the camera Component to a CameraActor, maybe that would work, but it didn’t either. Apparently that can’t be done.
So when I have the skeleton as a blueprint, I can’t drop a cameraActor into the Blueprint, only a camera Component? When I do that, I can’t figure out how to tell the camera component to pull the translations off of one of the stages and just use that with an offset and follow that one bone.
I can drop a Scene into the Blueprint as you’d suggested before, and nest it under the SkeletalMesh in the hierarchy, but it only follows the root of the mesh which has no motion. My skeletal mesh has a root with 3 main skeletal parts that that have their own translations and rotations, and I need to be able to get the camera to follow the different stages as they transition.
Maybe I could apply each Stage to it’s own ActorBlueprint? I started doing that yesterday but realized that as I add more things to the scene it’s going to be parts and pieces all over the place, and they don’t align properly when dragged into the scene, although I’m sure there’s a way to tell it to be spawned into the scene at a precise location instead of dragging and dropping.
I’d like to have one master blueprint to handle the rocket. I want to do the same for Mercury and Gemini as well as Apollo. I’m just working with generic stages, etc. right now. I also want to visualize the differences between the flights, etc. This is really a visualization task I’m working on, and I think Unreal gives me better control over the graphics and ancillary functions like particles, etc. instead of using something like STK. Because of the length of the flights, I want to run a realtime stream of positions and orientations for all the parts as well. I think it’ll be easier to do that than importing a gigantic animation file. I’ll have to then figure out how to get the data from the realtime stream into the skeletal mesh…should be the same pipeline as mocap.
I finally figured out how to make a camera inherit a position from on of the stages. I think the rest is putting together some logic to tell it when to start moving. I am having all the geometry disappear after about 60 frames…not sure if this is a glitch or if it’s something I somehow keyframed into the .fbx file I imported. Either way, what everyone mentioned has helped me figure this out.