Hello,
i have use-case where I need to Record an Animation at runtime to use it in the editor. To be specific, I am planning to create an AR Application that uses the Car AI of Unity.
As you can imagine, there is not much space for the Vehicle to drive as the Application uses an Image Target (Vuforia) printed on a DIN A4 Page and it must not leave the Page, so that the User does not have to move the Camera around to keep track of the Vehicle. I want the vehicle to perform several maneuvers such as parking or overtaking.
So i thought about just using the Car AI to record an animation that later only handles the wheel Movement and the Rotation of the Car. The movement itself would be simulated by moving the road beneath the car and cull away all the objects outside of the target instead of letting the car actually move.
I cannot animate the Vehicle by hand, since I want the animation to be as natural as possible. Also I want to be able to modify it on the fly.
I know there have already been questions about recording Animations at runtime, but I do have further questions regarding the planned Scenario.
Since the built in Vehicle System uses Rigidbodys and Physics, it can happen that the car gets tossed around as soon as the User wobbles the Device. Huge Problem. This is the main reason I do not want to use the Car AI at all in the finished Application. If the user holds the Camera steady (even if the Camera wobbles only a little bit) everything is fine, but as you all know: never trust the user
Furthermore I am looking for a way to cull out all Objects outisde of the Tracker. Imagine an invisible Cube on top of the Tracker. Inside of that Cube, everything gets rendered. Everything outside of the cube will be cut off. What are possible Solutions for the Scenario? I thought about a custom Shader, Image Effect or maybe there is a built in solution for that.
Maybe there are other solutions that did´nt come to my mind. I would really be glad if you could help me with this.