geode icon indicating copy to clipboard operation
geode copied to clipboard

Add an editor object via c++

Open aceinetx opened this issue 1 year ago • 2 comments
trafficstars

Your Question

I tried editor_ui->createObject but it crashes the game with exception access violation (EditorUI::createObject + 121 | C:\Users\aceinet\code\LevelEdit\build\bindings\bindings\Geode\GeneratedSource.cpp:10149), do I need to create an undo point (but I don't know how to do that since editor_ui->createObject does not return GameObject*) or something?

aceinetx avatar Sep 07 '24 10:09 aceinetx

LevelEditorLayer::get()->createObject(objectID, position, true)

TheSillyDoggo avatar Sep 07 '24 10:09 TheSillyDoggo

LevelEditorLayer::get()->createObject(objectID, position, true)

Thank you! You probably saved me 2 days of my life lol

aceinetx avatar Sep 07 '24 10:09 aceinetx