Announcement

Collapse
No announcement yet.

Help generating land from Actor Blueprint

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Help generating land from Actor Blueprint

    Hi,

    I'm brand new to UE and decided to try my hand at using blueprint to create a game I've been thinking about.

    I'm kinda stuck at the first thing i tried which is to generate the land.

    the game i'm trying to build (i realise might be kind of advanced for someone just starting) is going to be like a replica of Retail Tycoon on roblox.


    What i'm trying to do just now is create a grid of cubes. Each cube is 1 by 1 by 0.2 and i'm trying to make a 20 x 20 square of them (which will be the plot that players can build their shop on.)

    Whenever i run the game, It looks like the new cubes are being spawned in the same place.

    Can anyone see where i've gone wrong? or if there's a better way of doing this?

    Click image for larger version

Name:	Bp.png
Views:	1
Size:	166.5 KB
ID:	1204816

    #2
    Creating literal integer isn't necessary.. But
    have you tried a bigger unit value as transform position?
    like:
    indexX * sizeX = xpos
    indexY * sizeY = ypos

    and set sizeX and sizeY to something higher than 1? cause a Cube with the scale of 1*1*0.2 isn't equal to 1*1*0.2 units. Perhaps your Cube has a size of 100cm*100cm*20cm, which could cause the Problem, that all cubes seem to stuck at the same location

    Comment


      #3
      Basically, they are being spawned in the same general space, only 1 unit apart each. What you need to do is offset them by the size of the cube per instance spawned. So if your cube is 100x100x20, you want to multiply the y * 100 and the x * 100.

      Comment

      Working...
      X