Multiple grids and only 1 recognized.

Good day to all !

I’ll tell you my “problem”.

Unreal Engine 5.32
Beginner
Tutorial followed: https://www.youtube.com/watch?v=Q4AOmT9aOEM&list=PLIrH9XV6Mf7G3XXYIjzr2-n9XKGwcFwQE&index=10

I got up to video 3 and managed to do everything like the developer.

However, for the purposes of my game, I need multiple instances of this grid. When I duplicate it, I end up with the last one placed as active and the others completely sidelined by mouse recognition.

I changed the variable types of references to BP_Grid to array and tried to call them all via a For Each Loop and yet nothing worked.

==>I had provided all the screenshots necessary for your understanding but the forum forbids me from doing so -_-

Sorry =S

I am aware that I am perhaps tackling a level WAY too high for a start, but I am also aware that I am and will remain alone on this project. I have no choice, if I want to make it happen, I have to start now =S

Knowing that I am a beginner, would someone be kind enough to explain to me the why and the how?

Thanks in advance.

Kind regards.

(One of your French neighbors who wishes you a good day =D)

1 Like

In vid 3/4 he shows you how to set the grid variable in the game mode, on begin play.

If you want more than one grid, you’ll need to do that on tick, and keep getting the grid as you move the cursor in the player.

You’ll need to rewrite the ‘get grid’ function, so that it returns any grid the cursor is overlapping.

Not super difficult, but not a great way of doing things.

Why not just have a bigger grid?

Hello and thank you for your help =)

The reason I don’t want a big grid is because I want to make a game based on the rooms of a house. For this, I do not need 1 grid of 50x50 but a succession of grids of 3x4, 3x3, 4x4, etc…
==> The ideal would then be to create a random generation of houses from a list of pre-created rooms.

In addition, I would also need to make movements on the flat furniture present in the house, I judged that copying/pasting a functional grid was the simplest way than carrying out a new series of calculations to determine the maximum and minimum height achievable =S

Ok, then you don’t need it on tick, but you do need to figure out where the grid actor is when you enter a room.

So you do the same thing you already have, but when you enter a room.

What if I “cheat”?

If I create a grid consisting of an instanced static mesh coupled with box collisions and add X instances to the X axis and X instances to the Y axis while doing the same for the box collisions , this way I should be able to create as many grids as possible. Additionally, this way, thanks to box collision, the boxes should react to mouse hover, right?

1 Like

Well, that would be a total redesign of the system. You don’t need to instance the grid components, unless you got thousands of them…

He’s not using collisions in the vid.

It’s really up to you.

Above all, I’ve been on Unreal for 2 months, 1 month of which was really looking for ways to create and manage my grids and, like any human being, I’m looking for simplicity =/

I’m just looking to find THE right tutorial or THE right explanation to understand how it works.

==> When I think I understand and I test something, I only break what worked until now =/

1 Like

You probably will never find THE right tutorial. But you will find several the you can combine to make your idea happen :slight_smile:

I’m afraid so =S

Afterwards I have to acquire knowledge and experience… Do in 2 months what took some people 8 years to do… Even if sometimes talents can be born, if some take so long it’s because you have to let time happen.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.