sjg Posted January 22, 2017 Share Posted January 22, 2017 Hey there, I recently got Leadwerks and I've been trying to nut it out by, well, doing things. Currently having a whale of a time, but as I'm unfamiliar with it, I'm having a problem. The situation is I have a class which I have created and when I instantiate it, it seems to create two instances of it at once. I won't bore you with the actual code, but my process is: 1. Class "Player" has (a) a pivot entity, (b) a Model::Box, and © a physics shape. (a) is parent of (b), (b) has © as its shape. Physics attributes are applied to the pivot entity. 2. Class "MainState" contains a "Player*", which comes into being via a static Player::create() method which, naturally, returns a "Player*" 3. After being called, the object is visible in the world, but when I call SetInput (or even AddForce) on the Pivot entity of my Player, two objects are visible. Both fly off in opposing directions when force is applied. Aside from me not really understanding how to correctly structure such a class in the Leadwerks ecosystem, I'm a bit baffled as to why this is happening. All I know is I'm creating two similar objects in the same physical space and when I move one, they bonk together and the other goes haywire too. The question is: why is it so? What should I do to my class in order to avoid that duplication? Sorry if this turns out to be (ironically) a duplicate of another post, but I couldn't find anyone else anywhere having the same thing happen. Quote Link to comment Share on other sites More sharing options...
sjg Posted January 22, 2017 Author Share Posted January 22, 2017 Never mind, I worked out it was due to something else entirely that I had written. I feel like an idiot now Quote Link to comment Share on other sites More sharing options...
gamecreator Posted January 22, 2017 Share Posted January 22, 2017 Ha, welcome to Leadwerks. I think we've all started or created a post only to realize our mistake after. Enjoy the engine! 1 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.