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"

AddComponent with C++ or analog

Hi guys, please help me, I created class that generated in the spline points static meshes, I make prototype in BP, using fuction AddComponent, but in c++ it dont use.I tried to use the information that I found on the forum, but it does not work, how do I build this logic? Video with prototype and C++ code : https://www.youtube.com/watch?v=ibdIOekPP-E Very hope on your help, best regards, your friend, Alex. p.s. sorry for my english, it's not my native language.

Product Version: UE 4.14
more ▼

asked Dec 06 '16 at 01:41 PM in C++ Programming

avatar image

73 6 11 15

avatar image thesilencelies Dec 06 '16 at 02:40 PM

I'm not sure I fully understand what you want. The documentation for AddComponent is here for C++: https://docs.unrealengine.com/latest/INT/API/Runtime/Engine/GameFramework/AActor/AddComponent/index.html

If you're still having troubles could you post an the code you have so far (or a similar example) so we can see what you already have and fix any easy errors? thanks

avatar image lipneteng Dec 06 '16 at 02:45 PM

Thx for your answer, I dont understand AddComponent() can be used in c++? I thought it only appropriate to use in BP. If it's true, can u write example of code(add static mesh component, for example) p.s. I tried: AddComponent(FName("Mesh"), false, GetActorTransform(), UStaticMeshComponent::StaticClass());

avatar image thesilencelies Dec 06 '16 at 03:05 PM

If you want examples (the above is a C++ interface, but I can't find anyone using it) this one is probably more helpful. https://docs.unrealengine.com/latest/INT/Programming/Tutorials/Components/1/

or if you need it at runtime https://forums.unrealengine.com/showthread.php?52410-What-is-the-correct-way-to-create-and-add-components-at-runtime

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

1 answer: sort voted first

Problem was solved, logic was is right, but in construction wrong display.

more ▼

answered Dec 06 '16 at 04:16 PM

avatar image

73 6 11 15

(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