<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.extremist.software/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=167.220.25.98</id>
	<title>Noisebridge - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.extremist.software/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=167.220.25.98"/>
	<link rel="alternate" type="text/html" href="https://wiki.extremist.software/wiki/Special:Contributions/167.220.25.98"/>
	<updated>2026-04-03T20:06:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.13</generator>
	<entry>
		<id>https://wiki.extremist.software/index.php?title=Unity_Block_Placing_Script&amp;diff=50140</id>
		<title>Unity Block Placing Script</title>
		<link rel="alternate" type="text/html" href="https://wiki.extremist.software/index.php?title=Unity_Block_Placing_Script&amp;diff=50140"/>
		<updated>2015-11-14T21:01:18Z</updated>

		<summary type="html">&lt;p&gt;167.220.25.98: updated code with comments -Trevor&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Block Placing ==&lt;br /&gt;
Have you ever wanted to let the player place blocks, like in a game like minecraft?&lt;br /&gt;
&lt;br /&gt;
Well now you can! BlockPlacer has been created to let you place blocks to your heart&#039;s content.&lt;br /&gt;
&lt;br /&gt;
Detailed comments have been included in the script so that you can look into how it works. The full explanation is too lengthy for a tutorial.&lt;br /&gt;
&lt;br /&gt;
[http://pastebin.com/140bv3kW Click this to get BlockPlacer.cs]&lt;br /&gt;
&lt;br /&gt;
== Adding it to your project ==&lt;br /&gt;
Copy the entire script from the pastebin.&lt;br /&gt;
Then go to unity, click create in the project box/window, and click C# script. Name it BlockPlacer.&lt;br /&gt;
Double-click it to open up the script, and replace everything with the code you copied.&lt;br /&gt;
Save it, and go back to unity.&lt;br /&gt;
&lt;br /&gt;
Go to your player in the hierarchy, and click the down arrow next to them. Then click FirstPersonCharacter.&lt;br /&gt;
Drag the BlockPlacer script into the inspector.&lt;br /&gt;
&lt;br /&gt;
Create a new cube. Drag the cube into the project panel. Then delete the cube from the scene.&lt;br /&gt;
Go back to where you put the BlockPlacer script, and drag the cube from  the project panel into the box that has the label &amp;quot;Block Prefab&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
You&#039;re done!&lt;br /&gt;
&lt;br /&gt;
== Writing code for BlockPlacer ==&lt;br /&gt;
In order to place blocks, you need to write some code to get blocks.&lt;br /&gt;
Alternatively, you could just click the Unlimited Blocks checkbox, but where&#039;s the fun in that?&lt;br /&gt;
Make a block that you can pick up, much like you made coins in that tutorial. Instead of adding a coin when you pick it up, make write:&lt;br /&gt;
&lt;br /&gt;
 BlockPlacer.addBlocks();&lt;br /&gt;
&lt;br /&gt;
That will give you a block that you can now place.&lt;br /&gt;
&lt;br /&gt;
Now that you can collect blocks, you can make all sorts of puzzles and challenges that require placing blocks to get around!&lt;/div&gt;</summary>
		<author><name>167.220.25.98</name></author>
	</entry>
</feed>