Jump to content
This site uses cookies! Learn More

This site uses cookies!

armedunity.com uses cookies to improve user experience.

By continuing to use this site, you agree to allow us to store cookies on your computer.

geckoo

Moderators
  • Content Count

    2,818
  • Joined

  • Last visited

  • Days Won

    158

Everything posted by geckoo

  1. Should I try again or it's ok?
  2. Will be hard to find this tutorial, but if you need a manager, you can learn about GUI on this forum. Maybe KillerKip main menu will be useful... or create your own manager. Sorry ++
  3. Assets/AutoCommit.cs(18,17): error CS0246: The type or namespace name `AutoSave' could not be found. Are you missing a using directive or an assembly reference? I have a problem with this declaration. Explanation please ++
  4. Слава советским ожившим мертвецам :YMAPPLAUSE:
  5. or just with an integer which it increases when player find a key and decreases when he uses a key. It works with a simple boolean - xSilv4r, in this case all doors are openable or not. Use an integer ++
  6. I agree, but this paradox which you have exposed seems to me more complex. In past I have created two games and I think they was originals, with a strange game play, but different... Nobody wants play with these games on Desura. Maybe I wasted my time. If I will create a zombies post apocalyptic survival game, I will famous. Choose your destiny - money and (vain)glory or another way...
  7. geckoo

    PlayerPrefs

    Someone has created this alternative script which uses the same functions like playerprefs. Try it if you want change location... http://pastebin.com/WfH5itGa
  8. I understand. If needed resume, we must find the compromise between send rate, volume info and CPU latency when compression needed. Each project is different. Thank you.
  9. Imagine a simple Quake with info to send position, rotation, weapon handed and animation. No teleport, no doors, no ladder... Do you think OnSerialize will be better than n lot of RPC functions? In your projet mpKit, your choice was been as well because OnSerialize is more efficient? Thank you for your answer.
  10. Hi folks. I'm trying to figure out how Unity uses networking. I have a separate client and server project - today again a little and uninteresting FPS multi. In fact I must do a choose between 2 alternatives. In first, I have coded an ordinary code with RPC which is used when entity has accomplished some conditions relatives to position, rotation or just a limit with the send rate. I use lerps function to smooth movements... In second, I can use a code which seems to me more complex and (maybe) more efficient, using OnSerializeNetworkView like in the famous and redondant NetworkRigidbody script (by M2H). I saw many interesting aspects for both. Finally I don't know which will be better for a paced FPS multiplayer. I know you are masters in this question. What do you think? Where is the best way? Thank you for you answers ++
  11. Thank you for this clear explanation which is a proof to me that you know perfectly this question about send rate. But I have again another question. You said in your example "you are sending 9 float values - position, rotation and scale". I don't understand why someone would send info about scale. Position and rotation I understand, but scale seems to me uninteresting. Why send bytes about scale? Maybe it's a stupid question. Sorry
  12. Vanity, all is vanity – the vice of vainglory Maybe an answer since you are qualified ?
  13. Ok I wait. I asked myself about this "eventually tool" to avoid lag and flood. If in a loop with condition an entity send 20 RPCupdateMovement and if network.sendRate = 15 (default value), which informations will be executed? maybe the last?
  14. using UnityEngine; using System.Collections; public class ExampleClass : MonoBehaviour { void Awake() { Network.sendRate = 25; } } May I decrease or increase bandwidth for a multiplayer project by this way? I read this simple explanation without precision : the default send rate (float) of network updates for all Network Views. To avoid flood and lag, do you think it's a good method?
  15. Super Hot is one of the best games ever created. I like this concept. Thank you for sharing this tutorial ++
  16. geckoo

    Only if

    http://www.indiedb.com/games/only-if Survival puzzle FPS game ???
  17. Finally I have coded this script which works perfectly. I share it with you. Maybe it can help somebody. Thank you for your help ++ using UnityEngine; using System.Collections; public class MovementUpdate : MonoBehaviour { private Vector3 lastPosition; private Quaternion lastRotation; private Transform myTransform; private Vector3 previousPosition; private float velocity; private bool anim = true; private float smooth = 5.0f; public GameObject oSpider; // Use this for initialization void Start () { if(networkView.isMine == true){ myTransform = transform; lastPosition = myTransform.position; networkView.RPC("updateMovement", RPCMode.OthersBuffered, myTransform.position, myTransform.rotation, anim); } else{ enabled = false; } } // Update is called once per frame void Update () { velocity = ((transform.position - previousPosition).magnitude) / Time.deltaTime; previousPosition = transform.position; Debug.Log(Vector3.Distance(myTransform.position, lastPosition) + " - " + velocity); if(velocity >= 1.0f)anim = true; if(velocity < 1.0f)anim = false; if(Vector3.Distance(myTransform.position, lastPosition) >= .2f || Quaternion.Angle(myTransform.rotation, lastRotation) >= 10.0f){ networkView.RPC("updateMovement", RPCMode.OthersBuffered, myTransform.position, myTransform.rotation, anim); } } [RPC] void updateMovement (Vector3 newPosition, Quaternion newRotation, bool anim){ if(!networkView.isMine) { transform.position = Vector3.Lerp(transform.position, newPosition, smooth * Time.deltaTime); transform.rotation = Quaternion.Lerp(transform.rotation, newRotation, smooth * Time.deltaTime); lastPosition = newPosition; lastRotation = newRotation; oSpider.animation.wrapMode = WrapMode.Loop; if(anim == true)oSpider.animation.CrossFade("Run"); if(anim == false)oSpider.animation.CrossFade("Idle"); } } }
  18. Maybe I can use rigidbody.velocity to define movement and animation? It's a good way?
  19. geckoo

    xibalba

    http://phoboslab.org/xibalba/ Tiny FPS doom-like ++
  20. geckoo

    Best games ever :)

    I forgot Bioshock the first and second episode ++
  21. using UnityEngine; using System.Collections; public class MovementUpdate : MonoBehaviour { private Vector3 lastPosition; private Quaternion lastRotation; private Transform myTransform; private float smooth = 5.0f; public GameObject oSpider; // Use this for initialization void Start () { if(networkView.isMine == true){ myTransform = transform; networkView.RPC("updateMovement", RPCMode.OthersBuffered, myTransform.position, myTransform.rotation); } else{ enabled = false; } } // Update is called once per frame void Update () { oSpider.animation.Play("Idle"); if(Vector3.Distance(myTransform.position, lastPosition) >= 2 || Quaternion.Angle(myTransform.rotation, lastRotation) >= 10){ lastPosition = myTransform.position; networkView.RPC("updateMovement", RPCMode.OthersBuffered, myTransform.position, myTransform.rotation); } } [RPC] void updateMovement (Vector3 newPosition, Quaternion newRotation){ if(!networkView.isMine) { transform.position = Vector3.Lerp(transform.position, newPosition, smooth * Time.deltaTime); transform.rotation = Quaternion.Lerp(transform.rotation, newRotation, smooth * Time.deltaTime); lastPosition = newPosition; lastRotation = newRotation; oSpider.animation.Play("Run"); } } } Hi all. This script updates movements with smooth and plays an unique animation - run. I search a way to come back in first state - idle, when player does no movement. I can't understand why these entities always "run" also when they didn't move. I did a mistake somewhere. Thank you for your help.
  22. geckoo

    Line Renderer

    Maybe an example will be helpful? Create a simple GO and add this script to create a simple laser effect. You need to instantiate this GO and send start/end vector3. I use too a boolean when my Raycast hits a collider/tag... using UnityEngine; using System.Collections; public class SimpleLaserScript : MonoBehaviour { public bool hit = false; private LineRenderer lr; private float lrWidth = 0.065f; private Color col; public Vector3 start; public Vector3 end; // Use this for initialization void Start () { lr = GetComponent<LineRenderer>(); lr.SetPosition(0,start); lr.SetPosition(1,end); lr.SetColors(col,col); lr.SetWidth(lrWidth, lrWidth); if (hit) col = new Color(1,0,0,0.35f); if (!hit) col = new Color(1,0.5f,0,0.35f); } // Update is called once per frame void Update () { lr.SetColors(col,col); col.a -= Time.deltaTime * 0.5f; if (col.a<=0f){ Destroy(gameObject); } } } To instantiate this GO, you can do like this : (...) if (Physics.Raycast(originRay, out endRay, 100f)){ if (endRay.collider.gameObject.tag == "player"){ // hit a player hit = true; }else hit = false; (...) GameObject newLaser = (GameObject)GameObject.Instantiate(myGO); newLaser.GetComponent<SimpleLaserScript>().start = originRay; newLaser.GetComponent<SimpleLaserScript>().end = endRay; newLaser.GetComponent<SimpleLaserScript>().hit = hit;
×
×
  • Create New...