- Home /
Duplicate Question
How to make a P2P Unity Android Game
Hi all, sorry if i'm breaking any forum rules but this is the first of many posts so apologies in advance.
I'm trying to make a basic game where a player can use their phone as a controller and another device would receive the inputs from that controller. I've managed to create a basic game in which a car drives around a plane using accelerometer based inputs.
I'm now trying to adapt this to get a second phone to control the car by collecting the accelerometer values from phone A, sending this information via Bluetooth to phone B which would then interpret this input and apply it to control the player in the game world displayed on phone B. Something similar to this (https://vimeo.com/61416263) without the AR and camera and only one phone is the controller, not both.
The problem is I have no idea how to initiate a Bluetooth connection from inside Unity, from the research i've done around the forums people have suggested they created a plugin in the Android Eclipse ADT and imported it into their Unity games but again, I have no knowledge in this area.
I've created a simple chat application in which two people can message each other via Bluetooth using the Android Eclipse ADT and Java code but again, I don't know how to translate this into Unity,(http://developer.android.com/guide/topics/connectivity/bluetooth.html).
I'm trying to create this game for my University project so buying a plugin from the Asset store and using that is out of the question. I'm coding in Java and JavaScript but I have some knowledge of C++ if necessary, for development i'm using the Android Eclipse ADT and a version of Unity 4 Pro at my university.
Any help would be much appreciated, and please do not hesitate to ask for any clarifications, thanks in advance for all of your help
do you mean like PadRacer or something? Just use the ordinary builtin networking in unity, it is completely done for you. Search everywhere here for 1000s of questions about networking in unity.
Also check out getjoypad.com which is amazing and totally unity-ready
again you just use the utterly normal networking in Unity. unity is, probably , the world's most popular platform for networked games now.
saying to buy from the asset store is "out of the question" is strange, FYI
you could work anywhere ($$anonymous$$cDonalds) for one day and make enough money to buy an Asset Store item -- versus say 100 hours of self-work. $$anonymous$$uch cheaper/faster to get stuff on the asset store. But, you don't need anything here.
I didn't know that unity has networking in it is it in windows or what
Follow this Question
Related Questions
Using Android plugin to access android controller information. 1 Answer
Android Services running in Unity 1 Answer
Connect to Bluetooth network within App 0 Answers
Using your Android as a controller for your Unity PC Game 1 Answer
Unity android bluetooth controller disconnect doesn't make array empty 1 Answer