Unity3D Drupal - A Tutorial

Hi guys! Its been a while since I posted anything on these forums (work has been getting in the way, no time for games dev :frowning: )

I just thought I would share my latest blog post with you all: How to embed Unity3D into Drupal based sites.

This blog post is based on Drupal 6, but if there is enough demand I’m sure I can knock up a Drupal 5 solution as well. I was going to code a Drupal module to handle Unity but I just haven’t got the time to maintain one, plus this tutorial uses stock Drupal modules and should be much more flexible and future proof.

Hope it will be of some use!

Here’s the link:

http://www.darkbreedmedia.co.uk/blog/adding-unity3d-your-drupal-site

Cheers!

Ben

wow! 161 views and no comments must be a record of some kind :smile:

Hope its been of use to some of you

having a unity web client as a CCK field will be immensively useful for my project!

Since I’ve been working with drupal professionally for a while, I feel much more confident in my ability to create solid basis for enhancing the community. Hopefully I will be able to make some sort of hybrid game between Drupal and Unity.

Thanks a lot!

I was planning to find someone who could do this for me. My brother, who loves drupal and has some programming skills, wanted to start making something like this. Well, i just wanted to let you know that you solved hours of programming and more hours of finding the right solution for the tool, by posting this.

Cheers!

Ok, it worked for me to play unity on the frontpage of my website. But when i click on the game title i get a unity error that can’t find the unity3d file anymore. Does someone have an idea how i can fix this?

Thanks!

Haven’t tried this yet, but this is outstanding. Thanks for sharing your hard work. I’m starting to use Drupal more and more, and I’m certain this will be very useful.

Can someone please help me solve my strange problem? Any help will be appreciated.

When you say you clicked on the ‘Game title’, do you mean the HTML link or actually within the Unity player?

Excuse me for a very late respond, i had troubles with hardware and other issues.

By saying ‘Game Title’ i meant the post in which the unity file is located. On the frontpage every file can be played and it works perfectly, but that isn’t what i need. So the strange thing about this situation is that it can be played on the frontpage, but not in a post where the unity file is situated.

Any ideas?

If anyone is interested, I’ve had to make some minor changes for this to work with Drupal 7. This is based off the tutorial from the original poster ( http://www.darkbreedmedia.co.uk/blog/adding-unity3d-your-drupal-site )

  1. You don’t need to install the CCK and Filefield modules anymore. They are part of Drupal 7.

Find the following in the instructions:

  1. Under “Creating the node template” - “Find your node.tpl.php file and duplicate it, renaming it to node-unity.tpl.php”
  1. Under “Embedding the Player”

Change the first line of code:

var uniObj = new UnityObject(“<?php echo $node->field_unity_player[0]['filepath'] ?>”, “unity”, “640”, “480”, “2”);

to:

var uniObj = new UnityObject(“<?php echo file_create_url($node->field_unity['und'][0]['uri']) ?>”, “unity”, “640”, “480”, “2”);

Thank you very much for posting, mate. I’ll try this out as soon as possible.

Hmm, this didn’t work. We’ve edited the code a little because of minor issues, but after all the only thing i see when i click on a game title is a unity player saying the file isn’t a Unity3D file. Any ideas?

Hi agentcooper,

The link seems to be broken :frowning:

Any chance it will be available again?

Thanks in advance.

The website on which this tutorial was posted is being rebuilt. It would be awesome tho if someone else posts a good tutorial on this.

Was able to use this tutorial successfully, thanks to the Wayback Machine:

http://web.archive.org/web/20100510135834/http://www.darkbreedmedia.co.uk/blog/adding-unity3d-your-drupal-site

I’ll probably post a new tutorial for this in my blog, as a few things had to be changed for drupal 7 (other than the post by tsumea)

I´m really looking for that for Drupal 7 … :slight_smile:

…Edit:

ok, I wasnt able to sleep before i get this working for Drupal 7.

here you go link

Did anyone get this to work or have a working demo?