- Home /
Motion Models, Reading external data, Frame Rate and Way Points
Hi, I have 4 questions. 1. Do we have Fly, Drive, Walk etc motion models readily available with Unity3D? Where can I find them and how to use them? 2. How to read flight data (position, heading, pitch, roll, speed etc) sent by external application using Unity3D and assign the same to Aircraft at real time and fly accordingly. 3. How to check frame rate of the scenario while scenario is running? 4. Is it possible to create way points for any objects and make them move? Regards, SR
Answer by supernat · Dec 19, 2013 at 03:09 PM
1) You can get your hands on Drive and Walk models by purchasing plugins from the asset store, and there may be a Fly model in there as well. There is a built-in walk model, but I find the asset store versions are better. Which one you need depends on your application.
2) Just use sockets to transmit data from somewhere to Unity. Unity uses a version of Raknet I believe. Of course you can also purchase additional networking plugins for other server APIs, in and outside of the Asset store. The one I like is called ElectroServer.
See networking links: http://docs.unity3d.com/Documentation/Components/NetworkReferenceGuide.html http://docs.unity3d.com/Documentation/Components/net-MasterServerBuild.html
It seems part of your question would indicate you want to fly a real aircraft using this data. I can't not recommend Unity for this, but I can't recommend it at the same time. Flying a real aircraft requires precision and a steady stream of updated commands. Depending on the vehicle, i.e. a helicopter could be difficult, there could be cases where a loss of data means loss of aircraft. If you are researching doing this for a real aircraft like a UAV, you should be using a real time operating system, and thus Unity is not for you in my opinion. I have worked on a realtime Linux kernel in the past that was responsible for flying a real UAV, and you want to keep things simple. Unity would be a nice repeater or take inputs but not good for performing the realtime control, I guess is where I'm going with this. None the less, answering question 2 fully would take too long. Learn Unity first.
3) There is a "Stats" button in the Game window, click it to bring up stats. At runtime, you can use the Unity Script to get the frame rate: http://wiki.unity3d.com/index.php?title=FramesPerSecond
4) Yes, that is possible. The easiest way would be to create a game object in the editor for each waypoint you want, then assign those game objects to a script. Inside the script, create a state machine for your waypoints and interpolate through each point using Vector3.Lerp() and the passed in game object's transform.position property.
Your answer
Follow this Question
Related Questions
HELP: Arduino Genuino 101 to Unity3D. Serial Communication 0 Answers
Will frame rate affect Mecanim speeds? 1 Answer
Problem web service / standalone 1 Answer
Help to design an communicating character with user via Kinect ! 0 Answers
Can't get SendMessage in webpage to send info to the web player 1 Answer