playMaker

Author Topic: uNet Create Object  (Read 7143 times)

OmegaDEV

  • Playmaker Newbie
  • *
  • Posts: 8
uNet Create Object
« on: January 19, 2016, 12:15:52 PM »
I would like to Request a uNet Object Spanner regarding
http://docs.unity3d.com/Manual/class-NetworkIdentity.html

I have got everything working in my game, u can join match making, get in a game, run around and see other clients. Everything is working however i dont have a way to spawn the objects on the network.

I was hoping someone could help me in regards to spawning objects.
I want the player to be able to 'pick up, 'drop and 'spawn objects / prefabs.
Above is a link from unity wiki and below is an exert that explains what i need.

"With the server authoritative system of the Unity Network System, networked objects with NetworkIdentities must be “spawned” by the server using NetworkServer.Spawn(). This causes them to be assigned a NetworkInstanceId and be created on clients that are connected to the server"

Here is a link to my issues.
http://hutonggames.com/playmakerforum/index.php?topic=12059.msg56237#msg56237

Also in future im going to need to be able to Send and Variables, im to to sure on how to accomplish this either.

Thank you :)
« Last Edit: January 19, 2016, 01:31:00 PM by OmegaDEV »

OmegaDEV

  • Playmaker Newbie
  • *
  • Posts: 8
Re: uNet Create Object
« Reply #1 on: January 20, 2016, 02:31:58 PM »
I managed to get a spawning script working. I have solved my own issue :D However i think for the community sake this should be made into a custom action for uNet.
Here is a Request for a "NetworkServer.Spawn()" Action.
http://hutonggames.com/playmakerforum/index.php?topic=12061.msg56239#msg56239

Below is the code:


using UnityEngine;
using UnityEngine.Networking;
using System.Collections;

public class netSpawner : NetworkBehaviour
{

    [SerializeField]
    GameObject Prefab;
    [SerializeField]
    GameObject Spawn;
    private int Count;
    private int Amount = 10;

    public override void OnStartServer()
    {
        for (int i = 0; i < Amount; i++)
        {
            SpawnObject();
        }
    }

    void SpawnObject()
    {
        //Count

        GameObject go = GameObject.Instantiate(Prefab, Spawn.transform.position, Quaternion.identity) as GameObject;
        NetworkServer.Spawn(go);
    }
}
« Last Edit: January 20, 2016, 02:34:45 PM by OmegaDEV »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: uNet Create Object
« Reply #2 on: January 21, 2016, 10:08:37 AM »
Hi,

 thanks for your contribution.

 I will be tackling Unity Networking system this year for sure, to properly support it across all its features. I just don't have the time at the moment and need to first finish all my pending supports and addons work in progress... :)

Bye,

 Jean

OmegaDEV

  • Playmaker Newbie
  • *
  • Posts: 8
Re: uNet Create Object - Can i help?
« Reply #3 on: January 22, 2016, 08:50:26 AM »
Thank you for getting back to me, sounds great :) that's understandable, i know how it gets, ive been working on this project for a while now close to 4-5 years.

However can i offer my services in making scripts for the uNet Playmaker integration. Im currently trying to learn how to make custom actions, so i can do so myself. i would be happy to give them to you guys to modify in future to make ur jobs easier.

Again thank you for replying  :D

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: uNet Create Object
« Reply #4 on: January 26, 2016, 08:54:46 AM »
Hi,

 That would be very good indeed!

I would suggest the following:

 we setup a Github repository ( like I do for all my playmaker projects ), that will be feeding packages to the Ecosystem. Then everyone can contribute and benefit from this work.

 Should I setup something like that? I'll be willing to show you around if you think this is the way to go for your contribution.

Bye,

 Jean

treborjones

  • Playmaker Newbie
  • *
  • Posts: 24
Re: uNet Create Object
« Reply #5 on: June 30, 2016, 12:11:25 PM »
Hey guys, I just wondered if there was any timeline for these unet related actions?

Cheers,

Bob.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: uNet Create Object
« Reply #6 on: July 01, 2016, 03:27:44 AM »
Hi,

 It's pretty much all available already on github:

https://github.com/jeanfabre/PlayMaker--Unet-SubModule-

https://github.com/jeanfabre/PlayMaker--Standard--Assets--Network

and on the Ecosystem:



So If you are ok with github you can get in quickly, else you can download the two projects and combine them ( the "Submodule" rep goes into "Assets/PlayMaker Unet")

 I am currently focusing on Animator samples, and unet is likely following for a release on the Ecosystem with the meteroid sample.

Bye,

 Jean
« Last Edit: November 08, 2016, 03:25:48 AM by jeanfabre »

OmegaDEV

  • Playmaker Newbie
  • *
  • Posts: 8
Re: uNet Create Object
« Reply #7 on: November 05, 2016, 10:38:18 AM »
Hi jean im responding to this post from a while ago in regards to UNet custom actions. im trying to get:

https://github.com/jeanfabre/PlayMaker--Unet-SubModule-
https://github.com/jeanfabre/PlayMaker--Standard--Assets-

and im curently confused as to how to get them into unity without errors, cand u plz guid / help me ?

Sorry to ask, and also thankyou. :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: uNet Create Object
« Reply #8 on: November 08, 2016, 01:47:06 AM »
Hi,

 do you want to get them within a Unity Project that runs Github? or just as packages?

basically, just so you know, I am using Github Submodule system to paliate the lack of reusable libraries across Unity projects, and so if you host your Unity Project as a Github Repository, you can import these submodules directly as "sources" within your Unity project and using SourceTree, you can push and pull from them submodules separatly from the other files in your github rep.

 if you want to do that, Ill guide you, it's easy. else check this thread http://hutonggames.com/playmakerforum/index.php?topic=12060.msg63189;topicseen#new

I am in the process of making them available on the Ecosystem anyway so soon you'll get them directly from The Ecosystem browser.

Bye,

 Jean

Demonith

  • Playmaker Newbie
  • *
  • Posts: 32
Re: uNet Create Object
« Reply #9 on: February 03, 2017, 12:32:40 PM »
I imported thous two and this is my errors
http://hutonggames.com/playmakerforum/index.php?topic=14288.0