Androvikus Posted April 26, 2015 Report Posted April 26, 2015 Hi. I have made a door with 2 animations open and close, and put them to legazy in unity3d. Then i created an Object with a BoxColllider on, tied my script to the Object and placed the Collider around the door. see script below: using UnityEngine; using System.Collections; using System.Collections.Generic; public class OpenDoor_PCP_2 : MonoBehaviour { public enum Trigger { Collide, Click } private GameObject anim2; private Animation animation2; public GameObject t; public GameObject target; public Trigger trigger; public bool state = false; public AudioClip OpenSound; public AudioClip CloseSound; void OnMouseDown() { float distance = Vector3.Distance(target.transform.position, transform.position); if (state == true) { CloseInstance(); } else if(trigger == Trigger.Click && distance < 2.5f) { EnterInstance(); } } void EnterInstance() { Debug.Log("Open Sesame"); anim2 = GameObject.FindGameObjectWithTag ("OpenDoor_PCP_2"); animation2 = anim2.GetComponent(); animation2.animation.Play("OpenStyleA"); audio.clip = OpenSound; audio.Play(); t = GameObject.FindGameObjectWithTag ("OpenDoor_PCP_2_1"); t.collider.isTrigger = true; state = true; } void CloseInstance() { anim2 = GameObject.FindGameObjectWithTag ("OpenDoor_PCP_2");//AndersPrisonDoor animation2 = anim2.GetComponent(); animation2.animation.Play("CloseStyleA"); audio.clip = CloseSound; audio.Play(); t = GameObject.FindGameObjectWithTag ("OpenDoor_PCP_2_1"); t.collider.isTrigger = false; state = false; } } I looged in and could open and close the door with sound. All perfect, so i thought! Then i logged in with a new instance, so i had 2 players out, looking on the same door. When 1 of the players opened the door, the other player only saw a closed door? I looked around for a solution, but the only thing i found was 2 tutorial on Coordinated Effects, but none showed how to do a "coord object animation" to the door. So i dont know how to do a coord objecty animation to my door, andd i dont know how to coonect one to my door. So thats what i want to know how to do!! PLEASE HELM ME!!!!! Quote
3DOmelette Posted April 27, 2015 Report Posted April 27, 2015 yup, you need to synch network the door animation so other players can see, the way you have is only client side, so no multiplayer feature. I wish atavism devs can build a plugin for miselaneus networking stuff, where an object can easily be networked acrossed the network and synch animations and waypoint settings ie: door like yours without to be an actual mob or npc or ie: moving platforms too. etc.. not sure if handling the door as an actual npc or mob and disable patroling and disable killable etc... might work, not sure but you can give it a try and post results here. cheers Quote
Chasle Posted April 27, 2015 Report Posted April 27, 2015 You can use the coordinate animation effect of an object. Will do a tutorial this week about this. Using the Coord Effect Animation you can sync up any animation you want (doors or other kind of animation) Quote
3DOmelette Posted April 27, 2015 Report Posted April 27, 2015 was not awere of that, looking forward for the tutorial thanks Quote
Androvikus Posted May 8, 2015 Author Report Posted May 8, 2015 mm, Still waiting for the tutorial Chasle! Quote
neojac Posted May 8, 2015 Report Posted May 8, 2015 We are adding a state system to objects so you can basically set what state a object is in so say for instance open door or closed door or locked door. Then that will be shown and set for all players who looks at it or try and use it. It also allows for triggers and so forth. As soon as that's done it will be made into a tutorial. Quote
sooms Posted May 9, 2015 Report Posted May 9, 2015 To expand on this, we are looking at adding an interactive object system to atavism in one of the next couple releases which will be used for keeping track of states on the server for these objects. I'm quite excited about it as it means you can have a real interactive world with players clicking on things or altering the states of objects that others will see etc. Quote
3DOmelette Posted May 9, 2015 Report Posted May 9, 2015 very nice, something like this i was wishing for, will make the kit more robust. as well as moving platforms plugin too, aswell as a waypoint system plugin that can work with them and npc to make them move or patrol to pre set paths including path loops. this will enhance the kit a lot. hopefully this last 2 are aswell in the roadmap too thank you Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.