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"

ActorLineTraceSingle() returning inaccurate hit result

Hi, I'm trying to align a spline onto the surface of a landscape by using landscape->ActorLineTraceSingle() to get the Z location on the landscape at all the spline points. However, though all the spline points are near the surface of the landscape, most of the spline points are not exactly on the surface. Is this supposed to happen or am I doing something wrong?

The following is the code I'm using.

 FCollisionQueryParams collision = FCollisionQueryParams(FName(TEXT("trace")), true, this);
 if (landscape != nullptr && landscape->ActorLineTraceSingle(hit, FVector(x, y, 100000), FVector(x, y, -100000), ECC_Visibility, collisionParams))
 {
   z = hit.Location.Z;
 }
Product Version: UE 4.10
Tags:
more ▼

asked Jan 07 '16 at 09:58 AM in C++ Programming

avatar image

Xin Min
17 6 9 9

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

1 answer: sort voted first

Not an expert with landscapes...but I wonder if the collision geo doesn't always match the render geo? Can you turn on collision debug and see if the points are landing there?

more ▼

answered Jan 07 '16 at 05:00 PM

avatar image

Ryan Darcey
836 47 45 70

avatar image Xin Min Jan 08 '16 at 01:32 AM

Hi, I'm not sure if I'm turning on collision debug but I have added a TraceTag to the FCollisionQueryParams and there seems to be upward arrows between the surface of the landscape and the spline points beneath the surface. What does it mean?

avatar image Ryan Darcey Jan 08 '16 at 02:31 AM

Can you post a screenshot?

avatar image Xin Min Jan 08 '16 at 05:43 AM

I'm sorry but I'm doing this project on a secured network so I am unable to provide any screenshot or photo.

(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