Jump to content
ScarPunk

Can we add c++ to objects ?

Recommended Posts

Hello every one !

Today i wanted to add c++ code to object but looks to accept only lua script 🤷‍♂️

It is possible to add c++ into this box

831746215_Cisforwhat..thumb.PNG.e254eb6a9f7d0820adb68b4f59c6b385.PNG

 

Or we just use c++ into app.cpp (add class but every thing is connected to the app file) ?

 

 

Share this post


Link to post

like spiderpig said only lua is accepted in that box.

But.......
The c++ Actor class is what your looking for.

  • Like 2

Share this post


Link to post

hi Josh, I can't find any reference to Actor in the API documentation, is this intentional?

 

Share this post


Link to post
8 minutes ago, Gonan said:

hi Josh, I can't find any reference to Actor in the API documentation, is this intentional?

 

Yeah it’s not exactly a regular class because it must have a class of your own derived from it. There is no default functionality.

Share this post


Link to post
3 minutes ago, SpiderPig said:

Is this the correct way to use it?


//Header.h
class CustomActor : public Actor
{
public:
	virtual void UpdatePhysics();
};

//CPP.cpp
void CustomActor::UpdatePhysics()
{
	//Do Stuff
}

 

Yes

  • Thanks 1

Share this post


Link to post

on the page https://www.leadwerks.com/learn?page=Tutorials_CPP_Actors we have:

" By default, a new game will include a sample actor class you can modify called "MyActor". The code for this can be found in the "MyActor.h" and MyActor.cpp" files in the "Source" folder in your game directory. "

but i do not have any of those files in that directory, i have only : App.cpp, App.h, main.cpp

so where can i find them?

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...