x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

[C++ Tool] Select Actor in Editor using C++

Hello everyone!

I'm creating a tool in C++ and I want my actor to select another actor in the editor/world. Precisely, on the Actor's EditorKeyPressed event, I check if the enter key is pressed, actor is selected, and if the actor has a parent actor. If all conditions are met, I would then select the parent actor.

Thanks!

Product Version: UE 4.8
Tags:
more ▼

asked Jul 30 '15 at 10:57 PM in C++ Programming

avatar image

ポケレゲ
20 3 4 8

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

GEditor->SelectActor(...)

https://docs.unrealengine.com/latest/INT/API/Editor/UnrealEd/Editor/UEditorEngine/SelectActor/index.html

I think all you need is input actor. Lot of editor operations can be done from UEditorEngine, which global pointer to is GEditor.

https://docs.unrealengine.com/latest/INT/API/Editor/UnrealEd/Editor/UEditorEngine/index.html

Remember that if you put this code gameplay module place editor code inside #if WITH_EDITOR #endif borders or else your project won't cook.

more ▼

answered Jul 31 '15 at 12:04 AM

avatar image

Shadowriver
36.5k 930 169 1111

avatar image ポケレゲ Jul 31 '15 at 01:06 AM

Thanks for the answer! (^_^)

avatar image Ryan Darcey Aug 03 '16 at 10:06 PM

hmmm...got this error when I tried. any ideas?

1> [2/2] Link UE4Editor-Prizefighter-Win64-Debug.dll 1> Creating library C:\UnrealEngine\Prizefighter\Intermediate/Build/Win64\UE4Editor\Debug\UE4Editor-Prizefighter-Win64-Debug.lib and object C:\UnrealEngine\Prizefighter\Intermediate/Build/Win64\UE4Editor\Debug\UE4Editor-Prizefighter-Win64-Debug.exp 1>Module.Prizefighter.cpp.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) class UEditorEngine * GEditor" (__imp_?GEditor@@3PEAVUEditorEngine@@EA) 1>C:\UnrealEngine\Prizefighter\Binaries\Win64\UE4Editor-Prizefighter-Win64-Debug.dll : fatal error LNK1120: 1 unresolved externals

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question