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"

Get location of a component from class

Hi everyone

I add a component in my class,and I need to spawn some instances according to this component's default relative location so these instances won't collide each other.

I know I can spawn them first and then move them or store the location in a var but this two ways seem a bit silly.Is there a way to get the location directly from the class?

Product Version: UE 4.18
more ▼

asked Mar 04 '18 at 07:48 AM in Blueprint Scripting

avatar image

62 6 11 15

avatar image AmphDev Mar 05 '18 at 07:34 AM


What do you want exactly? im not sure i understod..

For me seems you overcomplicate a thing.. You try to spawn components around a class which is exist in the world and have a special component?

Can you clarify a little bit more?

avatar image Surtur Mar 06 '18 at 05:31 PM

Thanks for replying I want to spawn some actors from a class.But the location of those actors are detemined by the relative location of two component in the class. Actually I'm spawning road:the class is the base class of road pieces,the components are taging the start and end of the piece;there are no static meshes in the base class because in the subclasses there may be several meshes and some space between them

avatar image AmphDev Mar 06 '18 at 05:36 PM

Well you can add vector variable as default variable and set them where you want.. and try to get class defaults.

or go to c++ and use deferred spawn

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

0 answers: sort voted first
Be the first one to answer this question
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