Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Contributor
xvart
Posts: 36
Registered: ‎05-30-2012
My Device: playbook developer

Remote First-Person Control in Unity for PlayBook

[ Edited ]

Hi,

 

For a gallery installation, I had developed an AIR-based remote controller for Unity couple of months ago. I did not have time to share it but I had just submitted it to BlackBerry World and I wanted to share the news.

 

First: This works if you are also a Unity developer such that you have to put correct objects scripts into Unity in order this to work. And then you can control a First Person character (movement and look only).

 

The application uses TCP/IP protocol and Unity acts as the host while PlayBook acts as the client. The two do not need to be in the same network. Right now the port is hardcoded to 8090. There are two control schemes available.

 

Since it was designed for a gallery exhibition, the current version does not give any feedback if things go wrong. However, whenever the remote is activated or a button is touched, the application checks the connection and if it is not connected, it re-establishes the connection.

 

I will put the link to the application once it is approved in the BlackBerry World. I will also create a Z10 port and followed by a Q10 port.

 

The BlackBerry App

 

Let's look at the setup screen:

 

Setup Screen

 

In this screen, you enter the IP address of the machine running Unity. And then, you need to choose either a pad only or a button and pad combination control scheme.

 

Let's look at Pad only:

 

Pad Only

 

The screen is divided into two: The right side allows you to look around (like mouse look) and the left side allows you to walk. The application supports multitouch and for both side you need to touch and drag. There is no specific center so you can start touching from any part of the active areas. The amount and the speed of  the movement or head movement depends on the difference between the initial touch point and the current point of touch. The exact speed of the actions can be adjusted from Unity side.

 

Let's look at the button and pad scheme now:

 

Buttons and Pad

 

In this case, the right side works exactly as the prior case. However, for walking you have to touch on the arrows. You can still multitouch but it is a more 'digital' option (like wasd control).

 

Unity Package

 


The package can be downloaded from: https://www.dropbox.com/s/xck002lu30ili13/FPController_PlayBook.unitypackage

 

It contains the followings:

  • FPController_PlayBook: A modified version of standard FPS controller
  • TCPHost.cs: The host script for Unity. This needs to be put in the plugins folder (because of the order Unity looks at the folders)  and is put there by default. This code is based on This code is based on the JitReceive.cs from mu (myu) Max-Unity Interoperability Toolkit developed in Virgina Tech. DISIS
  • FPSInputController.js: A modified version of the FPSInputController that Unity is shipped with
  • MouseLook2.cs: A modified version of the MouseLook.js in C#
  • CharacterMotor.js: CharacterMotor.js from Unity

All these files come as a bundle and when the package is imported everything is put into correct folders.

 

To create a test scene just create a new project without any packages. Put a plane and import the FPController_PlayBook package and make sure that the port 8090 is not blocked. When you run the application from the tablet enter the IP of the computer into the tablet.

Please use plain text.
Contributor
xvart
Posts: 36
Registered: ‎05-30-2012
My Device: playbook developer

Re: Remote First-Person Control in Unity for PlayBook

For some reason, I was unable to edit my initial post further but here is the application:

 

http://appworld.blackberry.com/webstore/content/27406123/?countrycode=US

Please use plain text.