Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Beauke · Jun 26, 2019 at 08:19 PM · networkingcross-platform

Simply trigger a method over network

Hi all,

for my project I need to be able to connect an android device over the network to a standalone to simply call a method, I've tried so many tutorials, other answers, reddit posts but nothing seems to work. Especially with UNET being deprecated it seems to get even harder since pretty much all tutorials from mid 2018 and earlier are obsolete now. So I did found a replacement HLAPI called Mirror on the asset store which seems to be fine but I honestly just have no clue where to start. If anyone could give me a push in the right direction that'd be awesome.

What I need: I have 2 different projects, one for the pc, which runs the main game. The other one is a different android project running on my phone. The question is; how do I make it so I can connect the phone to the PC and use it to remotely trigger methods? I don't need any rendering of the actual game on my phone nor is it considered a seperate player (So I can't use the default NetworkManager which usually does everything for you) It should just display a simple UI with a few buttons to execute methods in the standalone game.

To be clear: The 2 instances that should connect are on different platforms from different projects (since 1 project can't simultaneously be on 2 platforms without switching which takes ages to re-import so this doesn't seem practical)

Thx, Beau

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image galalhassan · Jul 01, 2019 at 09:48 PM 0
Share

Is this going to work on local network only or do you want it to connect over the internet?

avatar image Optrix · Jul 01, 2019 at 10:26 PM 0
Share

Normally this sort of communication is done via a SERVER in the middle - something both devices know how to access, and the server will distribute the messages between clients.

But if your IP addresses are both going to be static, you can do-it-yourself directly in .NET.

https://docs.microsoft.com/en-us/dotnet/framework/network-program$$anonymous$$g/asynchronous-client-socket-example

https://docs.microsoft.com/en-us/dotnet/framework/network-program$$anonymous$$g/asynchronous-server-socket-example

One device opens a server socket, one device opens a client socket, and they communicate on the stream. You'll need to feed the Windows build the IP of the Android device and the Android device needs the IP of the Windows one. I'd suggest placing the server socket on the Windows build - just be aware of your firewall.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

153 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Network troubles using router 0 Answers

UNET - Broadcast Data from Android changes when PC joins Network 1 Answer

Unity networking tutorial? 6 Answers

No response from AWS in android build? 0 Answers

unity unet multiplayer with oculus rift vr - having the oculus only control the local player 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges