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"

How To Find the Height of Level Floor?

I have my player create buildings and then release them into the game world. The challenge is... how to find the Z height of the level floor so I can set the building directly on the floor. Any suggestions to handle this would be appreciated, thank you.

Product Version: Not Selected
Tags:
more ▼

asked Aug 01 '14 at 01:49 AM in Blueprint Scripting

avatar image

DreamBotStudios
146 32 48 54

avatar image Jacky Aug 01 '14 at 01:56 AM

Perform a line trace from the building(or the player i guess) to the floor and get the hit location?

avatar image Valkon Aug 13 '14 at 02:21 PM

what if there is something blocking the floor?

avatar image Jacky Aug 13 '14 at 02:29 PM

You can filter what the trace should ignore or not.

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

1 answer: sort voted first

As Jacky said, tracing is the way to do it. And filtering can be achieved by creating a custom collision channel and then trace only for that channel.

The BP method is called 'Single Line Trace By Channel'. To add custom channels check how Epic created custom channels for their ShooterGame. It is all in the projects DefaultEngine.ini under the [/Script/Engine.CollisionProfile] group, apart you should then also create a define in your main game header (in case its a native project) to make you life easier.

An example (the response can be block or overlap, depending on what you need in each case):

 [/Script/Engine.CollisionProfile]
 
 ; customized game channel
 ; if you do this, make sure you define in native for convenience
 +DefaultChannelResponses=(Channel=ECC_GameTraceChannel1, Name=Floor)
 
 // customize engine profiles, have custom settings for custom responses
 // to check the original set up, check BaseEngine.ini
 +EditProfiles=(Name="FloorProfile",CustomResponses=((Channel=Floor, Response=ECR_Overlap)))

This would be what goes into your main header (ShooterGame.h in case of Epic example project):

 /** when you modify this, please note that this information can be saved with instances
  * also DefaultEngine.ini [/Script/Engine.CollisionProfile] should match with this list **/
 #define COLLISION_FLOOR        ECC_GameTraceChannel1

Hope this helps.

EDIT: I'll resolve the issue. If you still need assistance please re-open it.

more ▼

answered Aug 13 '14 at 02:41 PM

avatar image

Moss
6.4k 127 98 606

avatar image Moss Oct 02 '14 at 05:12 PM

Where you able to achieve your goals?

avatar image RyzonPT Sep 05 '18 at 05:20 PM

no1 can ever achieve his goals!

(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