x


place 1X1X1 brick in a invisible 3d grid?

hi does anyone know a script that will do so if you click some where a 1X1X1 brick will be creted where i pressed but it has to stick to a 1X1X1 grid

example: i click on the floor somewhere and a brick will be created but has to stick to the grid. now if i then again click on the brick, another brick will be created still sticking to the grid and be placed on the side of the brick i pressed.

Please do help

more ▼

asked Dec 14 '10 at 08:04 AM

Frank Hansen gravatar image

Frank Hansen
16 12 12 15

Can you explain in more detail how the interface works? If you click to place a brick, and then click again on the brick that you just placed, how do you determine on what side of the previous brick the new brick is created?

Dec 14 '10 at 10:51 AM Jesse Anders
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Ahoy there, you could try using Mathf.Round() on the x, y and z coordinates of the position you intend to instantiate the new brick at.

more ▼

answered Dec 14 '10 at 02:00 PM

Helix gravatar image

Helix
127 1 1 6

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1679
x268
x23

asked: Dec 14 '10 at 08:04 AM

Seen: 1036 times

Last Updated: Jul 15 '11 at 07:54 PM