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.

Rod

Member
  • Content Count

    112
  • Joined

  • Last visited

Community Reputation

1 Neutral

2 Followers

About Rod

  • Rank
    Member

Profile Information

  • Location:
    Mexico
  • Interests
    Animation, 3D Models, Unity3D, Scripting.
  1. Thanks Ill check that. Update: Enemies Waves Time Walk Run sound Working on customization And more.
  2. Hi there, so I want to share my advances on the FPS I'm making. Here's the build : https://dl.dropboxusercontent.com/u/96027707/NewFPS/v.018/v.018.rar Comments and opinions greatly apreciated Controls: ASWD : Movement Mouse :Camera 1 : Change to gun in slot 1 2 : Change to gun in slot 2 R : Reload Click Left : Fire Click Right : Aim It's still far away from completion so it still has bugs and the models are bad. There are some bots using A* Pathfinding.
  3. Hey there grim, in modeling how do you make it so that the arms model at the for arm doesnt bend when you grab the gun?
  4. Incredible! I always wonder how to make parkour, last time I tried programming it it went horrible je
  5. Great! Just study the code and understand how it works so you can implement it yourself in future codes! Cheers! =) Heres the code if you want the shot gun to shoot 3 bullets only by selecting in inspector shotgun. #pragma strict var BulletPrefab : Transform; var force : float = 2000; enum gunType{ machinegun, pistol, shotgun } var shotGunSpawnPoints : Transform[]; var _gunType : gunType; //// use this with the inspector to selection your option var timeShot : float = .1; var timepassed : float; var spawnPoint : Transform; var gun : Transform; //// definening and caching you transform instead of calling it every frame will give you better fps add gameobject to the inspector function Start(){ timepassed = Time.time; } function Update(){ CheckGunType(); if(Input.GetButton("Fire1") && Time.time > timepassed){ timepassed = Time.time + timeShot; if(_gunType == gunType.shotgun){ for(var i : int = 0; i < shotGunSpawnPoints.length; i++){ var shotbullet : Transform; shotbullet = Instantiate(BulletPrefab,shotGunSpawnPoints[i].transform.position, gun.transform.rotation); shotbullet.rigidbody.AddForce(transform.forward * force); } }else{ var bullet : Transform; bullet = Instantiate(BulletPrefab, spawnPoint.transform.position, gun.transform.rotation); bullet.rigidbody.AddForce(transform.forward * force); } }///close update } //// think as this as a kitchen oven switch works if you select machinegun with the inspector the switch changes to macginegun and happen all in the case function CheckGunType(){ switch(_gunType){ case gunType.machinegun : timeShot = .1; break; case gunType.pistol : timeShot = .3; break; case gunType.shotgun : timeShot = .2; break; } } Test it though for bugs or something, just select the spawn points array, make elements 3 and add the spawn points to the shotgunSP array. It should work but justt test it PS: Ok I tested it and you didnt add #pragma strict this make you fix it or else it gives you an compile error helps alot to have a working code.
  6. Wow nice gonna check it out, but first have to finish a decent gameplay before entering multiplayer. It would be cool if it where photon compatible. Less hassle with server creation.
  7. Im gonna use some of my code from my scripts var BulletPrefab : Transform; var force : float = 2000; enum gunType{ machinegun, pistol, shotgun } var _gunType : gunType; //// use this with the inspector to selection your option var timeShot : float = .1; var timepassed : float; var spawnPoint : Transform; var gun : Transform; //// definening and caching you transform instead of calling it every frame will give you better fps add gameobject to the inspector function Start(){ timepassed = Time.time; } function Update(){ CheckGunType(); if(Input.GetButton("Fire1") && Time.time > timepassed){ timepassed = Time.time + timeShot; var bullet = Instantiate(BulletPrefab, spawnPoint.transform.position, gun.transform.rotation); bullet.rigidbody.AddForce(transform.forward * force); } } //// think as this as a kitchen oven switch works if you select machinegun with the inspector the switch changes to macginegun and happen all in the case function CheckGunType(){ switch(_gunType){ case gunType.machinegun : timeShot = .1; break; case gunType.pistol : timeShot = .3; break; case gunType.shotgun : timeShot = .2; break; } } I think it should worked its not tested PS: If you implement it pls post pics and vid =) Cheers!.
  8. Its in the right side, in the same mini slide menu where you find a gameobjects properties, its icon is a little world.
  9. Rod

    Help with follow Script

    Ok ok thanks, I got an Idea now. Thanks
  10. Rod

    Help with follow Script

    Ok but I want the GO to move based on the animation that comes with the mesh. How would I achieve that? Like for example if I move the mesh in blender to the side I want the GO to move based of the mesh animation. And the other problem is that the mesh would face the enemy target position. So does the camera except for the actual camera that would base its position relative to the GO but not its rotation. Here's is the code if it may help. #pragma strict var mainController : CharacterController; var runSpeed : float = 10f; var walkSpeed : float = 3f; var enemyTarget : Transform; var enemyPos : Transform; var direction : Vector3; var mainCamera : Transform; var cameraPos : Transform; var velocity : Vector3; private var smoothFollow : SmoothFollow; //test var box : Transform; function Start () { mainController = GetComponent(CharacterController); smoothFollow = GetComponent(SmoothFollow); //enemyTarget = enemyPos.position; } function Update () { if(mainController.isGrounded) { direction = Vector3(Input.GetAxis("Horizontal"), 0,Input.GetAxis("Vertical")); velocity = direction; direction = transform.TransformDirection(direction); direction *= walkSpeed; if(Input.GetButton("Jump")){direction.y = 15;} } direction.y -= 10 * Time.deltaTime; mainController.Move(direction * Time.deltaTime); print(velocity.magnitude); print(velocity); } function LateUpdate() { if(velocity.magnitude>0) { //var rot : Vector3 = Quaternion.Euler(0,velocity.y * 90,0); //transform.forward = velocity; } mainCamera.transform.LookAt(enemyTarget); //CameraFollow(); LookTarget(); CF(); } /* function AlignController() { transform.rotation = transform.rotation.SetLookRotation(enemyTarget); }*/ function LookTarget() /// controller looks toward the enemy transform. ///100% { var relativePosition : Vector3 = (enemyPos.position - transform.position); var relativeRotation : Quaternion = Quaternion.LookRotation(relativePosition); var relativeRot : Quaternion = Quaternion.Euler(0,relativeRotation.eulerAngles.y,0); transform.rotation = relativeRot; } function CF() { var direction : Vector3 = (mainCamera.transform.position - transform.position); var endPosition : Transform; endPosition = this.transform; var finalAngle : Vector3; var f1: Vector3; var a = endPosition.position.z; f1 = endPosition.TransformPoint(Vector3(0,0,a)); f1 = mainCamera.position - endPosition.position; mainCamera.position = f1; mainCamera.eulerAngles.y = Vector3.Angle(finalAngle,direction); } function CameraDirection() { var trans : Vector3; var relativePos : Vector3 = (transform.position - mainCamera.position); trans = transform.TransformDirection(relativePos); return trans; }
  11. Whats the best way to make follow script for the camera to follow a target but is not affected by the target rotation? so if the target moves forward or back the camera still doesnt rotate with the object. I tried making a transfrom and make the camera move to that point but it should not be effected by its rotation its half works but still. Or can some someone point me some optimal way to do it? function CF() { var direction : Vector3 = (mainCamera.transform.position - transform.position); var endPosition : Transform; endPosition = this.transform; var finalAngle : Vector3; var f1: Vector3; var a = endPosition.position.z; f1 = endPosition.TransformPoint(Vector3(0,0,a)); f1 = mainCamera.position - endPosition.position; mainCamera.position = f1; mainCamera.eulerAngles.y = Vector3.Angle(finalAngle,direction); }
  12. Ok ok I checked now. Select camera > Go to World in object options in the right side of the camera > go to Gather > give samples a bigger value.
  13. Make the sample rate like 30-50 that should take out the noise. I just dont remember where it had to be changed but im sure it was in the camera render options.
  14. Rod

    mouse sensitivity

    Modify your mouse look script or the script that has the code of the camera movement. and multiply var speedX : float = 5.0f; function Update() { trasform.localEulerAngles.y += Input.GetAxis("MouseX") * speedX; } if you are using eulerAngles just add this " += Input.GetAxis("MouseX") * speedX;" to the var, Input.GetAxis gives back a value of -1 to 1 depending on the for you move your mouse, mutiplied by the speed that is 5, so it means that where adding at eulerAngles Y a value from -5 to 5 depending to where we move our mouse. If you want it faster make speed bigger, if you want it slower make speed smaller value. hope you understand.
  15. I think its the particle_body prefab that has the blood effect, just select the material and add the dust texture again to the material.
×
×
  • Create New...