epsilonion Posted January 8, 2015 Share Posted January 8, 2015 Hi, I am interested in doing a cockpit for a space type game. I will create a model in 3DS max or blender, I am just wondering how to attach it to the first person camera in LUA, would it be a similar process as adding a HUD but not with the Draw command. What I want to do is have clickable objects in the cockpit etc etc as well but that looks like it is the easy part lol... I would use C++ but I am not comfortable enough with it yet so I would prefer to use LUA... any help, I would be thank full for it.. Quote Link to comment Share on other sites More sharing options...
drarem Posted January 8, 2015 Share Posted January 8, 2015 I think in the Scene tab you can drag the cockpit under the camera (or vice versa), to make it a child. Then when you move the camera around, the cockpit will follow. In Lua, you might use something like a SetParent command. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 8, 2015 Share Posted January 8, 2015 If you want to move your camera freely around the cockpit, then you load the model of the cockpit/place it in the scene. However do not parent it, since you can't move the mouse to press any buttons. If freelook is not needed, then you can parent it. Load/place the model. have a camera that contains a script with the camera rotation. in the same script you can use raycast to detect other objects that are part of the cockpit. If you want to move the cockpit, then the cockpit should have its own script Quote Link to comment Share on other sites More sharing options...
MarkusR Posted January 8, 2015 Share Posted January 8, 2015 the cockpit is more a sphere where u put the camera in. i would memory the cam in the sphere script as property. if it set if self.cam ~= nil then self:SetCamToCokpit(self.cam) end at top Sphere script Script.cam = nil --entity "Used Cam" Quote PC : Win 10 Pro 64 Bit , 4x cores ~2 GHz , 8 GB RAM , AMD R7 265 2D : Photoline , Zooner Photo Studio 13 , Art Rage Studio 3.5.4 , Ashampoo Snap 7 , ... 3D : Shade 15 Basic , Carrara 8.5 & DAZ Studio 4.8 , Cheetah 3D 6.3.2 , Via Cad 8 Music : Samplitude Music Studio , Music Creator 7 IDE : Leadwerks Engine 3.x , Unity 5.x , (Unreal 4.8.x) , AGK v2.x , Construct 2 , (Clickteam Fusion 2.5) , ShiVa 1.9 , Game Maker Studio , MS Visual Studio .Net , Android Studio , Monkey , ... Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.