Friday, June 10, 2016

Interaction in unity3d with Google Vr sdk (google cardboard)

I'm putting this mini tutorial here because I keep forgetting each step to get stuff interactive in Unity3d with Google VR sdk
Install the Google VR Unity sdk ( )
Assets - Import Package - Custom Package
locate the google sdk where you downloaded it,
select all and import.

Next delete the main camera from the scene.
Add the GoogleVR-prefabs/GVRMain.
Add GoogleVR-prefabs/UI/GvrReticle to the GvrMain/Head object.

Add a floor object. 20x1x20, give it a texture so you can see it better when moving.
Move the GvrMain up about 1.8 m

You can now look around and have a reticle.

Now we want to be able to interact with objects and have the reticle have a sortof 'mouseOver'-effect.
To get this to work we need to:
Add a Physics Raycaster component to GvrMain/Head/Main Camera.
Add ui/EventSystem to our scene.
Add GazeInputModule to the EventSystem in our hierarchy. Make sure to move this up so that its above the StandaloneInput module.

Now we add a cube to the scene, and add an Event Trigger component to it. (This is important, because without the eventTrigger (even if you dont have an event added) the GvrReticle will NOT ot respond when you look at the object)

Thats the minimum you need to get object interactivity.
You can now add a ointer click event for example and do some useful stuff there.

Next step, how to get the coordinates of the location you clicked on.

Sunday, April 15, 2012

Iso map

I've been wanting to write an ISO game for a long time now, but I've never gotten my game idea straight.

Still haven't... so I decided to just start off with an ISO map routine first and see how well it runs on my Playbook.

Here's what I've come up with so far. not much functionality, but it works, and its nice and smooth on playbook. (Where we unfortunately can't use Starling because it doesnt support Stage3d yet :(

Click here (move mouse over screen to see it once loaded ;)

Tuesday, April 26, 2011


Our latest iPad game has been approved and is now for sale on the appstore!

rcBoats for iPad.

It's a fun little 2 player game where you can boat around in your own virtual pond.

Game idea, graphics, sound and programming all done by me :)

Don't forget to give it a (good) review if you pick it up ;)

Here's some screenshots:

Friday, December 3, 2010

Air for iPhone - loading external .swf files

If you are creating apps for iPhone with Air, you might have the need to load external .swf files.
In my case, it was the need to be able to have downloadable content.
I can't really think of another reason why you would want to do this, normally using .swc files is the way to go.


When you want to load an .swf file from an Air for iPhone application, there's some things you need to know.

Your .swf file cannot contain ANY actionscript whatsoever. Symbols in your library must also NOT be exported for Actionscript.

Adobe's documentation states that the scripting will simply be ignored, but that isn't exactly accurate.

If your .swf file contains Actionscript, the entire load will be ignored.
Which means you won't receive an Event.COMPLETE or even an IOErrorEvent.IO_ERROR when you try to load the file.

So, with no symbols exported to actionscript, all you're left with is animation on the timeline.

But I wanted to use it like a kind of library, where you could neatly pack all your graphics and animations and sounds in 1 swf, load it, and use the assets in your main program.

I've created a basic class to help with this.
Download StageLibrary with example project (flashdevelop)

This also works for android, but you have to change the path of the swf file.
Convenient if you create apps for android and iPhone that use the same assets.. if you're only creating android apps, you don't have the .swf scripting barrier that Apple enforces and can use library symbols like you usually do.

To create a swf file that will work with this class, create a .fla file of 1 frame in size.
and place all the symbols you want to use on stage and give them an instance name.

If you want to create a soundclip, make a movieclip, keep frame 1 empty, and place your sound on frame 2, making sure to add enough frames for the duration of the audio. If you don't add the extra frames, you wont be able to detect when the sound stopped playing.

StageLibrary takes care of loading the swf and collecting all instance names and allows you to quickly 'grab' a clip from stage, to use somewhere else in your app. (You can simply addChild() a clip from the library to your own stage/displayobjectcontainers)
I've also added a function to easily play a sound clip, that also has a callback when the sound is finished.

You can't reuse an object though, you aren't creating new objects, you're just moving them from stage to your app.
You can put more than 1 instance of a symbol on stage though, just make sure you give them a unique instance name.

It is also possible to use more than 1 frame in your main movie, but this has the effect of killing all animation of your objects (except for subclips with animations)

Check out the example project. It should be self explanatory, I even commented the code!
If not, post your questions/remarks here and I'll see what I can do :)

Thanks to Renaun Erickson, Seb Lee-Delisle and Joe Chung.

Also check out Renaun's blog entry with another loading example which helped me figure out what was wrong here

And finally, for those of you who like to tinker some more:
I've found that you CAN create multiple copies of an object on stage by changing frames of your main animation.
get a symbol from stage, go to frame2, go to frame 1 again, now you can get that same symbol again, and now you have 2 yaay.
Unfortunately, it screws up the animation in your object, except for subclips. But it could be useful to know ;)

Happy coding!

Friday, October 22, 2010

Raceportal, our 2nd iPhone App

Hey people,

Another quick note to let you know that our 2nd app "Raceportal" has been approved for the appstore and is now available to buy :)

Check it out here :

Tuesday, September 14, 2010

My first Iphone App

Just a quick note to tell you guys that my first Iphone app is now available for free on the itunes appstore.

click here to download

It's a webcomic reader for Dutch webcomic artists (some comics can be in English)

Artists can upload their comics on my website and get their comics featured in the app :)

Hope you guys (those of you who have iphone/ipad's or ipod touches) enjoy it :)

Monday, August 16, 2010

Definefont error

Changing the look and feel of a game I developed in FlashDevelop, I suddenly got the following error when trying to compile the project in FlashDevelop:

WARNING: end of tag DefineFont3 is @55343, should be @58327
Build halted with errors (swfmill)."

To make a long story short, this was caused by a textfield that didn't embed any characters. Thanks to Philippe for providing the answer.

So, If you get this error (the numbers after the @ will probably be different) check your movieclips for textarea's without embedded characters.

And to make this short story a little longer: (for those of you who are still reading ;)
My problem in finding this was that I used 1 font library, and had all my textarea's set to use that as the font...
But I still had 2 buttons, with the same font, but not using the font library.
So the error occured when I changed the font in the library.
Now the 2 buttons didn't share a font that other textarea's used, and had characters embedded for them.

And due to the fact that it wouldn't compile, I couldn't visually verify all textarea's to be the same at runtime.

Click here to see my thread about it on