No announcement yet.

spawn platforms randomly

  • Filter
  • Time
  • Show
Clear All
new posts

    spawn platforms randomly

    Hi there,
    it's me again with some trouble we have on programming our endless runner game. Again it's the first time we dig into the UE4 and the blueprints.
    Our idea is to spawn 10 platforms at the beginning. After activating their triggers, we delete the last and add a new platform. This concept worked fine till we tried to spawn 2 different platforms randomly.

    This is how we spawn our platforms. I debugged the value of LastPlatformPosition, it's correct calculated.
    Click image for larger version

Name:	Unbenannt.JPG
Views:	1
Size:	95.0 KB
ID:	1139361

    When I ran the game, the platforms aren't placed how they should be...
    Click image for larger version

Name:	Unbenannt2.JPG
Views:	1
Size:	42.0 KB
ID:	1139362
    Click image for larger version

Name:	Unbenannt3.JPG
Views:	1
Size:	39.1 KB
ID:	1139363

    They overlap for some reason we coulnd't figure out yet.
    Do you have any idea how to fix this problem?


    I believe you need to add the length of your last platform, not the length of the new one. If you make a variable for Last Platform Length, and one for Current Platform Length, that should sort things out.
    Map Generator 1.0
    Map Generator 2.0
    Map Generator 3.0


      Oh, that's right. Thanks a lot!
      Last edited by basteln; 10-11-2014, 09:54 AM.