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"

Spawn Grid Based on Landscape

Hey, hope you guys are doing great! This is my first post on UE answerhub, even though I’ve been reading and checking it since UDK. Sadly, that does not means I know a lot of the engine, on the contrary, I’m have trouble with what I think should be really simple things.

Recently, despite of not having that much time, I’ve decided to start working in a pet project, one I’ve been wanting to try my hands on for some time now.

The goal is to create a “real time, turn based combat”. The main point is that I want to have grid-based movement for the character and turn-based action. I’ve tried some tutorials and learned the following: I cannot have grid-based without spawning a grid to move on. The issue is that I wanted an ‘open map’ feeling or something similar. Procedural Room Generation helped me understand how to spawn a grid and how to use it to determine movement and how to set a ‘turn’ order.

So, I thought: “Well, why not create the grid, based on the player location when ‘combat starts’ and use it during ‘combat’ to determine movement?” The solution seemed at first easy to achieve could potentially solve my problem.

So, to test my solution, I created a small event on blueprint level, to spawn the grid once the F key is pressed: alt text

As you can see, the grid spawn at the character location, which is good, however it doesn’t follow the terrain deformation, as you can see in the following image: alt text

The blueprint used to spawn the grid is the following: alt text

The question is: How to set the Z coordinate to match the one in the landscape? I tried creating a function that I would pass the xy position and use a linetrace based on it to return the z, but it didn't worked as I hoped It would.

Any ideas?

P.S: Sorry for my poor English, it’s not my native language.

Product Version: UE 4.8
more ▼

asked Sep 08 '15 at 02:44 AM in Blueprint Scripting

avatar image

1 1 1 2

(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