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"

Any way to get world pos from components local+some kind of offset

Hello. I have the scenario where i have a component that is supposed to spawn actors in a 'grid-like' manner. The problem is I don't know how make that it uses the component local position/rotation as an offset to spawn then with offset.

I mean if the component is rotated his local Z vector will point in a different direction. So i want to use that Z vector to spawn along the actor with '50' units offset from one another, and go along X or Y for row offset. And SpawnActor ( ) uses world coordinates ;/ So I am looking for a way to turn the local coordinates + offset to world coordinates.

My first several attempts I used to - but only works for aligning everything horizontal and in one direction, and i give the piece/segment rotation manually.

FVector location = GetComponentLocation( ) + FVector( -50 row , -50 line , 0 ); APipeSegmentC * segment = World->SpawnActor( m_BlueprintTemplate , location , m_PieceRotation ) ;

Product Version: UE 4.9
more ▼

asked Nov 05 '15 at 01:24 PM in C++ Programming

avatar image

44 10 10 14

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

So with help of a collegue who is better at math then me we solved the problem - so here is how it goes FVector location = GetComponentLocation( ) + GetRightVector( ) line ( -50 ) + GetUpVector( ) row ( 50 ); - by using Right and Up vector and the offset of 50;

more ▼

answered Nov 05 '15 at 02:13 PM

avatar image

44 10 10 14

(comments are locked)
10|2000 characters needed characters left
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