playMaker

Author Topic: Object placment question  (Read 1353 times)

belfis

  • Playmaker Newbie
  • *
  • Posts: 5
Object placment question
« on: November 08, 2018, 02:47:07 AM »
Greetings, trying to solve the problem of placing roads on my stage. Everything seems to be working out but I cannot understand how to implement the construction of the road in this form ( at the moment I get this way (http://recordit.co/sm86da8AY0). Please push me on the right way to solve my problem.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Object placment question
« Reply #1 on: November 08, 2018, 04:31:40 AM »
Hi.
I think there are some raycasts or triggers going on, to check if there is an object next to the mouse.
And if there is then check what kind of object.

Then determine what object should be on the cursor as well as the connecting objects.

But it will not be easy to set up. you will need to use arrays, get the data on what side the cursor is from the nearby object, etc.

It is doable tho

I think you might be better of purchasing the asset.
https://assetstore.unity.com/packages/tools/modeling/road-creation-102888

You might need to request for playmaker actions to the owner tho.
If he is willing you can let him contact me if he needs help

belfis

  • Playmaker Newbie
  • *
  • Posts: 5
Re: Object placment question
« Reply #2 on: November 08, 2018, 04:48:17 AM »
I would like to try to implement it myself, I do not really understand the logic of construction. I learned quite well how to use the arrays and the other of the playmaker actions. Not many would you help to understand the logic. If you painted the order how it should interact, I could do it.

Sorry for my English )

Fat Pug Studio

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
    • Fat Pug Studio
Re: Object placment question
« Reply #3 on: November 08, 2018, 05:18:33 AM »
There's a cool city building blog of this guy: http://www.irrlicht3d.org/pivot/entry.php?id=1601

He's not going into technical details, but i suppose he'll get there. Anyway, raycasting and snapping to grid, not much to it.

Btw i don't see what wrong with your way on the gif?

edit: ah i see, you want to drag and lay multiple blocks without having to click for every block. That's a bit advanced, i recommend you check some city building tutorials for unity on youtube.

« Last Edit: November 08, 2018, 05:31:30 AM by krmko »
Available for Playmaker work