Slastraf Posted May 2, 2021 Share Posted May 2, 2021 How do I handle the camera creation in c++ ? I create a camera in c++ and it works fine but the Camera has no GetCurrent() so how do I pass it down to the player script ? Basically what is the equivalent of entity.script.camera in cpp ? I need the camera in both c++ and lua. Quote Link to comment Share on other sites More sharing options...
reepblue Posted May 2, 2021 Share Posted May 2, 2021 There isn't a default way of doing this. You'll need to use the SetKeyValue functions for the camera entity and then do a for loop to find and store the camera into a global variable on the lua side. This is why I mostly do everything in C++. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Slastraf Posted May 2, 2021 Author Share Posted May 2, 2021 Have just gone "around" this issue like this Quote world:GetCurrent():ForEachEntityInAABBDo(self.entity:GetAABB(),"Callback",v) and for some reason the camera was always in the aabb so i just checked if the entity in the parameter of callback was the camera Quote 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.