playMaker

Author Topic: Shifting from one lane to another and generate terrain  (Read 1804 times)

fredy999

  • Playmaker Newbie
  • *
  • Posts: 2
Shifting from one lane to another and generate terrain
« on: January 17, 2014, 01:06:50 PM »
Hi,

This is my first post in the forum, so sorry if it's in the wrong place. Let me introduce myself : I'm a 17 year old currently trying to create an endless runner game for iOS.

I just started using playmaker and I find it very useful and interesting. Because I barely have any experience in programming (although I do know unity script), I decided to give playmaker a go.

I was wandering how I could shift from one lane to another after a swipe event. Everything works except the actual movement. I tried using lerp, but I can't figure it out.

I don't know at what point my player has to start at and at a what point he has to finish.
My player's vector is 0 0 0. So is the middle platform's vector. Left platform is -6 0 0. Right platform is 6 0 0.
They are all under an empty "_Platform" game object. Because the platform is constantly moving backwards, the Z point is constantly changing too.

And second of all, I don't know how to generate terrain. I've created a few prefabs for my terrain, but I've no idea where and how to spawn my prefabs. I also want the prefab to be chosen randomly.

Thank you in advance.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Shifting from one lane to another and generate terrain
« Reply #1 on: January 27, 2014, 04:20:25 AM »
Hi,

 to spawn prefabs, you simpy use te action "Create Object" and refernce your prefab, it will create an instance out of it.

 to pick random prefabs, use the action "Select Random Game Object", or implement some more advanced system using ArrayMaker, and store all your various prefabs in a hashtable and pick them randomly.

https://hutonggames.fogbugz.com/default.asp?W715

But if you are beginning, I would suggest the first approach.

bye,

 Jean

fredy999

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Shifting from one lane to another and generate terrain
« Reply #2 on: February 01, 2014, 04:55:23 PM »
Thanks, for the info.