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.

kasazwix

Member
  • Content Count

    40
  • Joined

  • Last visited

Community Reputation

0 Neutral

About kasazwix

  • Rank
    Member

Profile Information

  • Gender
    Not Telling
  • Location:
    ippi
  1. How do I reset a objects position every 5 seconds to the original position ?
  2. Hello how can I do that when I fall on a glass, the glass will break in 10 pieces ?
  3. This is the script to see the the video clip , with unity 3d -------------------- var movieTexture : MovieTexture; function Start() { movieTexture.loop = true; renderer.material.mainTexture = movieTexture; movieTexture.Play (); } --------------------
  4. Hello everyone , I always use the 1280x960 resolution when I use unity 3d , I created a video clip that can be seen with unity 3d , and when i use the resolution 1280x960 everything is fine when i watch the video clip , but when I start to use the 1920x1080 resolution in addition to video clip is also seen a small part of the skybox , how can I do that when I change to the 1920x1080 resolution to not even see the skybox ? I do not even want to see the skybox at the resolution 1920x1080 but only the video clip
  5. this script does not work well crashes
  6. I need the script for the movement of a character, and not the character controller
  7. who has a third-person movement player script ?
  8. but how can I increase the speed of the object ? because it is too slow
  9. how can I make an object move forward automatically continuously without ever stopping?
  10. yes , i have the animation called reload , and I've marked also as legacy the animation , but it does not work the same, how can I solve this problem ?
  11. Hi guys , why I have this error with this script? -------- the animation state could not found not be played because it couldn't be found ------ function Update() { if(Input.GetKeyDown("r")) { // Plays the reload animation - stops all other animations animation.Play("reload", PlayMode.StopAll); } }
  12. I need that when i press space the ball goes in superspeed
  13. I have the script, but I want that must be equal to marble blast gold ---------------------SCRIPT--------------------------------- // speed of the ball public var speed = 5.0; var superspeed = 10.0; var radius = 1.0; var currentSpeed; private var velocity : Vector3 = Vector3.zero; function Start(){ transform.localScale = Vector3.one * radius * 2; var hit : RaycastHit; if(Physics.Linecast(transform.position, transform.position - Vector3.up * 500, hit)){ transform.position = hit.point + Vector3.up * radius; } // add a rigidbody if we dont have one. if(!rigidbody) gameObject.AddComponent(Rigidbody); // set the mass according to the radius. rigidbody.mass = 50 * radius; } function FixedUpdate () { // let see if our body is on the ground. if(Input.GetKey("f")) { speed = superspeed; } else { speed = 5.0; } var hit : RaycastHit; var isGrounded = Physics.Raycast(transform.position, -Vector3.up, hit, radius * 1.5); // base movement off of the camera, not the object. // reset the camera's X to zero, so that it is always looking horizontally. var x = Camera.main.transform.localEulerAngles.x; Camera.main.transform.localEulerAngles.x = 0; // now collect the movement stuff This is generic direction. var direction = Vector3(Input.GetAxis("Horizontal"),0,Input.GetAxis("Vertical")); // prevent the ball from moving faster diagnally if(direction.magnitude > 1.0) direction.Normalize(); // If we are grounded, then lets see if we want to jump. if(isGrounded && Input.GetKeyDown(KeyCode.Space)) rigidbody.AddForce(Vector3.up * rigidbody.mass * 50); // if we arent pressing anything, dont mess with the physics. if(direction.magnitude > 0){ // convert isGrounded into something we can use var modifier = isGrounded ? 3.0 : 0.5; // lets set the direction according to the camera now. direction = Camera.main.transform.TransformDirection(direction) * speed * 2; // lets take the downward velocity from the current so that we dont get wierd physics results direction.y = rigidbody.velocity.y; // Now, lets keep track of a velocity. // This will let the ball move while we are not pressing anything. rigidbody.velocity = Vector3.Lerp(rigidbody.velocity, direction, modifier * Time.deltaTime); // Now, lets break the rotation out from the movement. var rotation = Vector3(rigidbody.velocity.z,0,-rigidbody.velocity.x) * 20; // Lets add some spin to make the ball move better rigidbody.angularVelocity = Vector3.Lerp(rigidbody.angularVelocity, rotation, modifier * Time.deltaTime); } // return the camera's x rotation. Camera.main.transform.localEulerAngles.x = x; }
×
×
  • Create New...