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.

Search the Community

Showing results for tags 'camera'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GENERAL
    • Introduce yourself
    • Discussions
    • Showcase
    • Need help?
    • Seeking team members?
    • Offtopic
  • RESOURCES
    • unity3D | Example Projects
    • unity3D | Scripts
    • unity3D | Shaders
    • unity3D | Tutorials
    • 3D models
    • Animated 3D Models
    • Graphic design
    • Textures
    • Sounds
    • Other
  • FREE FPS PROJECT
    • FPSKit Download
    • FPSKit Modifications/Tutorials
    • FPSKit WIP/Showcase
    • Discussions / Bug reports
  • SELL | REQUEST
    • Sell
    • Request
  • Mars' Modular Multiplayer Photon FPS Kit's Topics
  • Mars' Modular Multiplayer Photon FPS Kit's Reviews
  • Mars' Modular Multiplayer Photon FPS Kit's Updates
  • Mars' Modular Multiplayer Photon FPS Kit's Tutorials
  • Busy People's Introductions
  • Photon's Tutorials
  • Photon's Photon General
  • Photon's Showcase

Categories

  • Free Projects
  • Free Assets
  • Game Demos
  • Photon's Files

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


YouTube URL


Facebook URL


Twitter URL


IndieGoGo URL


Kickstarter URL


IndieDB URL


GreenLight URL


Location:


Interests

Found 34 results

  1. I have a gun script in which I have declared Now I wanna assign the weaponCamera of gun script from its parent's parent's to its parent(MainCamera). Means like this FPSController>Lean(empty gameobject)>MainCamera(i wanna assign this)>Body_1(gameobject)>Arms(gameobject)>M4A1. FPS controller>Soldier. I dont wanna assign camera manually to inspector because I instantiate clone of m4 gameobejct. Similarly I have declared I wanna assign this gameobject from FPSController's child to GameObject of GunScript.(public GameObject Soldier;) I know the question is pretty hard(or may i dont know how to ask questions like this). I tried various codes like : But it didnt work! Im stuck w/ it since Monday. Don't make comments on my english. NVM!
  2. Hi! While developing on a game of mine, I decided to make a few changes to the camera. I got some inspiration from the camera in Running With Rifles and I really liked it, so I decided to make it like that. Here's a little video of it in action, in my game: Setting it up: Create an empty gameobject, and name it something like Camera Pivot. This is the gameobject that will be moved. Create a camera gameobject, and attach it to the Camera Pivot gameobject Offset the camera gameobject so it points downward, and is a bit in the air Attach the script to the Camera Pivot gameobject. Configure the settings to your likings, and everything should work. If you have any problems, I'll try to help. Script:
  3. AshwinTheGammer

    Binocular Texture

    Here is a texture of binocular below is the link you can download it. I've tons of free awesome textures with copywrite. I've this so I'm sharing this with you peoples. https://mega.nz/#!1yg2kB4Z!4-3xhk0cc3gjwRGeyTgETgm7BuHJ7Yj6_50HHyhdDAc
  4. Greetings peeps, i want to get a swaying camera effect like in this video But somehow i can't do it, can anyone help me please Thanks in advance :3
  5. Digitex

    Big canvas & little main camera

    Hi, I'm a new beginner in unity trying to learn. I've got a project (Android) with one main scene but i don't understand the fact that i have a big rectangle (Canvas) and a really small rectangle (bottom left) for the main view. i'm having a lot of problem to control what's shown in a smartphone. I added a picture to illustrate my problem. I'm wondering : is it normal ? i don't think so .. How can i control exactly what's shown in the screen ? Thanks,
  6. ProExtremePL

    Object painter issue

    Hi guys, I've made script for custom object painting and of course I had to create empty script just with class and monobehaviour to be able to paint. But when I choose in hierarchy object that has this script I can't use camera :/ It can't move in any direction, can rotate, but can't move forward, up, down etc. But when I click on object that doesnt have this script (or just air) everything is okay. Any solutions? P.S Is it possible to make custom objects painting window without needing object with that empty script? Because if I choose object that has that script I'm able to paint on another ones that doesnt have that script... Thanks for all help!
  7. Hey guys i am making FPS game right now....for explosion i shake my camera with random.random....but i want to make shake in the direction of then explosion..just check out the following video and you will get it what i am asking. Untitled.mp4
  8. |Cinematic Camera Shake| -Description: This is a perfect script if you are making a cutscene and you want to add a bit of "spice" , this will make your camera shake , you can modify it to make it fit in your cinematic. This can also be useful for earthquakes with the correct settings. -Useful Level : 7/10 (only useful for cinematics/cutscenes) --Script: using UnityEngine; using System.Collections; class Noise { Vector2 seed; float speed; public Noise(float speed) { this.seed = new Vector2(Random.value, Random.value); this.speed = speed; } public float Update() { seed += Vector2.one * speed * Time.deltaTime; return Mathf.PerlinNoise(seed.x, seed.y) * 2 - 1; } } public class CameraShake : MonoBehaviour { Transform myTransform; Vector3 initPos; public float bigRadius = 3.0f; public float bigSpeed = 0.5f; public float smallRadius = 0.5f; public float smallSpeed = 2.0f; Noise noiseBigX; Noise noiseBigY; Noise noiseSmallX; Noise noiseSmallY; void Start() { myTransform = this.transform; initPos = myTransform.position; noiseBigX = new Noise(bigSpeed); noiseBigY = new Noise(bigSpeed); noiseSmallX = new Noise(smallSpeed); noiseSmallY = new Noise(smallSpeed); } void Update() { myTransform.position = initPos + new Vector3(noiseBigX.Update() * bigRadius + noiseSmallX.Update() * smallRadius, noiseBigY.Update() * bigRadius + noiseSmallY.Update() * smallRadius, 0); } }
  9. Aeleas

    Use raycast as a pointer ?

    I'm using third person camera for a car. this car have a gun. it shooting but because the camera is above the car it get hard the aim at any enemy or spot far from the car. I need from my raycast give me the coordination (X,Y) of any object block the ray, so that can i use it for my bullet direction. here is my code: using UnityEngine; using System.Collections; public class carCam : MonoBehaviour { Camera car_cam; public Transform target; void Start() { car_cam = GetComponent<Camera>(); } void Update() { Vector3 camScreen = new Vector3(0.5f, 0.5f, 0f); // center of the screen float rayLength = 500f; RaycastHit hit; Ray ray = car_cam.ViewportPointToRay(camScreen); Debug.DrawRay(ray.origin, ray.direction * rayLength, Color.red); if (Physics.Raycast(ray, out hit, rayLength)) { print ("Looking at : " + hit.transform.name); } } } What ever in the middle of my screen my bullet can reach it. I don't know if this is right or wrong but i have to try.
  10. Hello, I am a noob to Unity and I'm having trouble making a simple change to a script. Hopefully someone can help! I've recently had success using the "FPSKit 1.3.5 JS" with "Google VR", using the "GvrViewerMain" Prefab. I had to make some simple changes to the scripts to allow the player to move and raycast in the "Camera Direction". I'm attempting the same method now, with the FPSKit 1.5 C# Before, when I was using the Unity "Standard Assets - FPS Controller" I could just attach the "GvrViewerMain" to the "MainCamera" and then "hold Alt for head movement simulation" worked perfectly. This time, (in the FPS 1.5 C#) I attach the "GvrViewerMain" to the MainCamera and, pressing the Alt key causes the camera rotation to be very strange. (rotating and tilting) Anyone have any ideas? Thanks in advance!
  11. nomax5

    Full Body FPS Ideas

    I'm trying to think of an elegant solution to this, and would like to know if you have any ideas The Requirement: First person view With a full body for multiplayer with animations I want the player to see their legs and arms etc. in first person. I want the player to be able to press a key and have "FreeLook" so that just their characters head moves, and they can use it to look back over their shoulder when something is chasing them. Nice to have's It would be nice to restrict head movement to natural limitations Some sort of Steady Cam, I've noticed when attaching cameras to head bones that the movement is too wobbly. So something to smooth out movement without intersecting with the character geometry when they jump for instance. My Ideas so far. I'm thinking that the head model should be separate but joined to the body at the neck, then I was thinking I could perhaps cul the head from the camera view and position it so it could never look down the neck hole. I was thinking of having an invisible sphere collider with the camera inside, that would prevent the camera intersecting with the body and then figure out some way of smoothing the camera movement within the sphere. Any ideas warmly welcomed, I really think that with the advent of VR headsets that "First Person" is going to be a hot subject.
  12. Bloky_CZ

    "Overlap" Problem.

    Hello, I have got a problem. In my car game I want to add moving speedometers, but there is the problem. My camera sees that speedometer needle overlaps with the display behind it. But it is not so. - http://imgur.com/5a2BQU1 : Cameras view. - http://imgur.com/dCy3dAM : In editor (As you can see, there is a gap between them). - https://youtu.be/VtLBNEXa4LU?list=PL5f0H3dHKn9eTeaMcYLZZju_vgvFThHsR : My car game videos. Thanks for help.
  13. Hey brothers, I am working for creating a boundary at the side of the screen using Camera. Means by the View of the screen and player position I am working on the code(C#) but seems to be not working. Var camera = camera.main; var currentplayerpos = transform.position; if( currentplayerpos > camera.main) { //................. the stop code for the player. / or the destroy the player and game finished/ } please help
  14. This is my first time posting here so please be easy on me if I do this wrong. This script was derived from various scripts found all over the web and some of my own scripting added. I used and tested this script under Unity 5.2 using ThirdPerson Controller script. HOW TO USE THIS SCRIPT: 1. Drop this script onto your camera. 2. Select your target. 3. Select Camera Type desired. (Freelook with or without collision) (WOW type with or without collision) 4. Set Camera Tag to MainCamera. 4. Set desired Height, Distance, Speed, etc... 5. Make sure you have Input for Mouse X and Mouse Y in your input manager. WOW mode: Click and Hold Right Mouse Button to orbit Release Right Mouse Button stop orbit Use Mouse Wheel to zoom Enjoy! // WOW/FreeLook type Camera with Smoothing, Zoom, and Collision Control @Header ("Object For Camera To Target") var target : Transform; @Header ("Camera Type") var cameraType: OPTIONSWOW = OPTIONSWOW.WOW; @Header ("Camera Hight Above/Below Target") var targetHeight = 2.0f; @Header ("Camera Distance From Target") var distance = 5.0f; var maxDistance = 20f; var minDistance = 2.5f; @Header ("Camera Rotation Speed Sencativity") var xSpeed = 250.0; var ySpeed = 120.0; @Header ("Camera Up and Down Limits") var yMinLimit = -20; var yMaxLimit = 80; @Header ("Camera Rotation Smoothing/Dampening") var smoothing = 20f; private var smoothedMouse = new Vector2( 0f, 0f ); var inputSensitivity = 125f; private var Ydirection = 1f; @Header ("Camera Zoom Speed") var spinAccleration = 5f; private var spinSpeed = spinAccleration; private var deltaDistance = 0f; private var x = 0.0; private var y = 0.0; public enum OPTIONSWOW { FreeLook = 0, FreeLookNoCollision = 1, WOW = 2, WOWNoCollision = 3, } @script AddComponentMenu("Camera-Control/WoW Camera") function Start () { var angles = transform.eulerAngles; x = angles.y; y = angles.x; // Freeze Rotation if (GetComponent.<Rigidbody>()) GetComponent.<Rigidbody>().freezeRotation = true; } function LateUpdate () { if(!target) return; switch (cameraType) { case OPTIONSWOW.FreeLook: smoothedMouse = Vector2.Lerp( smoothedMouse, new Vector2( Input.GetAxis( "Mouse X" ), Input.GetAxis( "Mouse Y" ) ), 1f/smoothing ); x += (smoothedMouse.x * inputSensitivity)*Time.deltaTime; y -= (smoothedMouse.y * Ydirection * inputSensitivity)*Time.deltaTime; distance += deltaDistance; distance = Mathf.Clamp (distance, minDistance, maxDistance); y = ClampAngle(y, yMinLimit, yMaxLimit); doAction (); break; case OPTIONSWOW.FreeLookNoCollision: smoothedMouse = Vector2.Lerp( smoothedMouse, new Vector2( Input.GetAxis( "Mouse X" ), Input.GetAxis( "Mouse Y" ) ), 1f/smoothing ); x += (smoothedMouse.x * inputSensitivity)*Time.deltaTime; y -= (smoothedMouse.y * Ydirection * inputSensitivity)*Time.deltaTime; distance += deltaDistance; distance = Mathf.Clamp (distance, minDistance, maxDistance); y = ClampAngle(y, yMinLimit, yMaxLimit); doNoCollision (); break; case OPTIONSWOW.WOW: // If right mouse button is held down, let mouse govern camera position if (Input.GetMouseButton(1)) { smoothedMouse = Vector2.Lerp( smoothedMouse, new Vector2( Input.GetAxis( "Mouse X" ), Input.GetAxis( "Mouse Y" ) ), 1f/smoothing ); x += (smoothedMouse.x * inputSensitivity)*Time.deltaTime; y -= (smoothedMouse.y * Ydirection * inputSensitivity)*Time.deltaTime; } distance += deltaDistance; distance = Mathf.Clamp (distance, minDistance, maxDistance); y = ClampAngle(y, yMinLimit, yMaxLimit); doAction (); break; case OPTIONSWOW.WOWNoCollision: // If right mouse button is held down, let mouse govern camera position if (Input.GetMouseButton(1)) { smoothedMouse = Vector2.Lerp( smoothedMouse, new Vector2( Input.GetAxis( "Mouse X" ), Input.GetAxis( "Mouse Y" ) ), 1f/smoothing ); x += (smoothedMouse.x * inputSensitivity)*Time.deltaTime; y -= (smoothedMouse.y * Ydirection * inputSensitivity)*Time.deltaTime; } distance += deltaDistance; distance = Mathf.Clamp (distance, minDistance, maxDistance); y = ClampAngle(y, yMinLimit, yMaxLimit); doNoCollision (); break; } // Mouse Zoom Start if (Input.GetAxis ("Mouse ScrollWheel") < 0f) { deltaDistance = Mathf.Lerp (deltaDistance, Mathf.Min (spinSpeed, maxDistance - distance), spinAccleration/10f * Time.deltaTime); } else if (Input.GetAxis ("Mouse ScrollWheel") > 0f) { deltaDistance = Mathf.Lerp (deltaDistance, -Mathf.Min (spinSpeed, distance - minDistance), spinAccleration/10f * Time.deltaTime); } else { deltaDistance = Mathf.Lerp (deltaDistance, 0f, spinAccleration * Time.deltaTime); } // Mouse Zoom End } function doAction (){ var rotation:Quaternion = Quaternion.Euler(y, x, 0); var position = target.position - (rotation * Vector3.forward * distance + Vector3(0,-targetHeight,0)); transform.rotation = rotation; transform.position = position; // IS VIEW BLOCKED? var hit : RaycastHit; var trueTargetPosition : Vector3 = target.transform.position - Vector3(0,-targetHeight,0); // Cast the line to check: if (Physics.Linecast (trueTargetPosition, transform.position, hit)) { // If so, shorten distance so camera is in front of object: var tempDistance = Vector3.Distance (trueTargetPosition, hit.point) - 0.28; // Finally, rePOSITION the CAMERA: position = target.position - (rotation * Vector3.forward * tempDistance + Vector3(0,-targetHeight,0)); transform.position = position; } } function doNoCollision (){ var rotationA:Quaternion = Quaternion.Euler(y, x, 0); var positionA = target.position - (rotationA * Vector3.forward * distance + Vector3(0,-targetHeight,0)); transform.rotation = rotationA; transform.position = positionA; } static function ClampAngle (angle : float, min : float, max : float) { if (angle < -360) angle += 360; if (angle > 360) angle -= 360; return Mathf.Clamp (angle, min, max); }
  15. Here is a free package that i made, is a top down shooter camera system ----------------------------------------------------------------------------------------------------- Note: is just the camera system, is not a shooting system :/ Note: Models are from botcamp and the player is from makehuman but you can change it ----------------------------------------------------------------------------------------------------- Images: http://s1056.photobucket.com/user/trollnonimo14/media/bhkljkfg_zpsyoxygnix.jpg.html?o=0 Download: http://www.mediafire.com/download/1ia8wo88e3pjfw3/TopDownShooter.rar
  16. FIRULAINS

    Player Shadow

    I moved the question to http://armedunity.com/topic/11761-create-shadow-of-player/.
  17. Hey, Here's a script I made which controls a free flying camera or spectator camera. It allows the user to move through the scene like a ghost. The camera movement can be disabled to just make it a mouse look script. Assign a tag to the camera like 'MainCamera', or whatever you want, then assign this script. You also need to make a new input axis called 'Up-and-Down' (which I assigned to 'space' and 'left ctrl' respectively) for up and down movement. You are free to use as you wish, if there is any way to write part of the code any better or more efficiently, do let me know and I will make changes or feel free to re-write it yourselves. If you are worried about licensing, don't be, it is the best license for free material. Just give credit where credit is due and indicate if any changes are made. Code - GhostCam C# //GhostCamera //By krasus //Date 08/01/2015 //Description //Free camera allows a camera to move through a scene like a ghost ( spectator camera ) //License //Essentially - give credit where credit is due //licensed under a Creative Commons Attribution - Attribution 4.0 International (CC BY 4.0) //http://creativecommons.org/licenses/by/4.0/ using UnityEngine; using System; [RequireComponent (typeof (Camera))] public class script_GhostCam: MonoBehaviour { #region Variables [Header("Camera Settings")] public float fieldOfView = 74.43f ;//The Camera Field of view (Default) public float sensitivity = 2.25f ;//Mouse movement sensitivity public float smoothing = 0.0472f ;//Mouse movement smoothing [Header("Movement Settings")] public float movementSpeed = 10 ;//The speed of movement of the camera public float movementMultiply = 2 ;//The speed of movement of the camera when sprinting public float verticalSpeed = 8 ;//The speed of movement of the camera when moving up and down public bool toggleMovement = true ;//Allow movement internal Camera MainCamera ;//Camera used by the player internal float xRotation ;//Horizontal movement internal float yRotation ;//Vertical movement internal float xRotationCurrent ;//Current horizontal movement internal float yRotationCurrent ;//Current vertical movement internal float xRotationVelocity ;//Horizontal movement velocity internal float yRotationVelocity ;//Vertical movement velocity #endregion //____________________________________________________________________________________________________________________________________________// #region Start - Find public void Start() { MainCamera = GameObject.FindWithTag(this.gameObject.tag).GetComponent<Camera>(); MainCamera.fieldOfView = fieldOfView; } #endregion //____________________________________________________________________________________________________________________________________________// #region Update - Camera Movement public void Update() { if(toggleMovement) { //Input float xAxisValue = Input.GetAxis("Horizontal") ; //X Axis a and d movement float zAxisValue = Input.GetAxis("Vertical") ; //Z Axis w and s movement float yAxisValue = Input.GetAxis("Up-and-Down") ; //Y Axis up and down movement //Movement float movementForwardSpeed = zAxisValue * movementSpeed * Time.deltaTime; float movementStrafeSpeed = xAxisValue * movementSpeed * Time.deltaTime; float movementVerticalSpeed = yAxisValue * movementSpeed * Time.deltaTime; //Sprint if(Input.GetKey(KeyCode.LeftShift)) transform.Translate(new Vector3(movementStrafeSpeed * movementMultiply, movementVerticalSpeed * movementMultiply, movementForwardSpeed * movementMultiply)); //Default else transform.Translate(new Vector3(movementStrafeSpeed, movementVerticalSpeed, movementForwardSpeed)); } } #endregion //____________________________________________________________________________________________________________________________________________// #region LateUpdate - Mouse Look public void LateUpdate() { //Hide cursor Screen.showCursor = false; Screen.lockCursor = true; //Camera movement yRotation += Input.GetAxisRaw("Mouse X") * sensitivity; xRotation -= Input.GetAxisRaw("Mouse Y") * sensitivity; //Clamp the X rotation xRotation = Mathf.Clamp(xRotation, -90, 90); //Camera movement smoothing xRotationCurrent = Mathf.SmoothDamp(xRotationCurrent, xRotation, ref xRotationVelocity, smoothing); yRotationCurrent = Mathf.SmoothDamp(yRotationCurrent, yRotation, ref yRotationVelocity, smoothing); //Camera applied movement transform.rotation = Quaternion.Euler(xRotationCurrent, yRotationCurrent, 0); } #endregion } Code - GhostCam UnityScript (JS) //GhostCamera //By krasus //Date 08/01/2015 //Description //Free camera allows a camera to move through a scene like a ghost ( spectator camera ) //License //Essentially - give credit where credit is due //licensed under a Creative Commons Attribution - Attribution 4.0 International (CC BY 4.0) //http://creativecommons.org/licenses/by/4.0/ #pragma strict import UnityEngine; import System; @script RequireComponent(Camera) //____________________________________________________________________________________________________________________________________________// @Header ("Camera Settings") var fieldOfView : float = 74.43f ;//The Camera Field of view (Default) var sensitivity : float = 2.25f ;//Mouse movement sensitivity var smoothing : float = 0.0472f ;//Mouse movement smoothing @Header ("Movement Settings") var movementSpeed : float = 10 ;//The speed of movement of the camera var movementMultiply : float = 2 ;//The speed of movement of the camera when sprinting var verticalSpeed : float = 8 ;//The speed of movement of the camera when moving up and down var toggleMovement : boolean = true ;//Allow movement private var MainCamera : Camera ;//Camera used by the player private var xRotation : float ;//Horizontal movement private var yRotation : float ;//Vertical movement private var xRotationCurrent : float ;//Current horizontal movement private var yRotationCurrent : float ;//Current vertical movement private var xRotationVelocity : float ;//Horizontal movement velocity private var yRotationVelocity : float ;//Vertical movement velocity //____________________________________________________________________________________________________________________________________________// function Start() { MainCamera = GameObject.FindWithTag(this.gameObject.tag).GetComponent(Camera); MainCamera.fieldOfView = fieldOfView; } //____________________________________________________________________________________________________________________________________________// function Update() { if(toggleMovement) { //Input var xAxisValue : float = Input.GetAxis("Horizontal") ; //X Axis a and d movement var zAxisValue : float = Input.GetAxis("Vertical") ; //Z Axis w and s movement var yAxisValue : float = Input.GetAxis("Up-and-Down") ; //Y Axis up and down movement //Movement var movementForwardSpeed : float = zAxisValue * movementSpeed * Time.deltaTime; var movementStrafeSpeed : float = xAxisValue * movementSpeed * Time.deltaTime; var movementVerticalSpeed : float = yAxisValue * movementSpeed * Time.deltaTime; //Sprint if(Input.GetKey(KeyCode.LeftShift)) transform.Translate(new Vector3(movementStrafeSpeed * movementMultiply, movementVerticalSpeed * movementMultiply, movementForwardSpeed * movementMultiply)); //Default else transform.Translate(new Vector3(movementStrafeSpeed, movementVerticalSpeed, movementForwardSpeed)); } } //____________________________________________________________________________________________________________________________________________// function LateUpdate() { //Hide cursor Screen.showCursor = false; Screen.lockCursor = true; //Camera movement yRotation += Input.GetAxisRaw("Mouse X") * sensitivity; xRotation -= Input.GetAxisRaw("Mouse Y") * sensitivity; //Clamp the X rotation xRotation = Mathf.Clamp(xRotation, -90, 90); //Camera movement smoothing xRotationCurrent = Mathf.SmoothDamp(xRotationCurrent, xRotation, xRotationVelocity, smoothing); yRotationCurrent = Mathf.SmoothDamp(yRotationCurrent, yRotation, yRotationVelocity, smoothing); //Camera applied movement transform.rotation = Quaternion.Euler(xRotationCurrent, yRotationCurrent, 0); }
  18. So looking into changing things on a current project I'm working on, and what I'm looking to do is have a 3d scene, underneath a 2d overlay.. Just to give it some life instead of using a static image for the city.. Basically the image below. I'm trying to find a way to display the city using a 3d perspective camera, and everything else rendered as 2d.. I'm playing around with different cameras, but hit a few roadblocks.. I do have NGUI that I bought quite a while ago and use it a lot.. and I'm wondering if it wouldn't be best to render all of my other elements as a 2d GUI on top of the scene.. Most of the interface I can do in NGUI that way I think, but some of the scenes I'd like to combine some 2d and 3d elements both.. and having never ventured into the world of 3d, I thought I would ask.. any thoughts or ideas or suggestions? I appreciate all your feedback!
  19. DariusRusu

    DirtCameraEffect

    Download the package Enjoy! Link: https://mega.co.nz/#!DRYzGKrQ!ZWKAlyuiz9ju3v4hQ0fAloSTMcPlceaJbNQrgGnX1JM
  20. hey i'm a noob but know the basics of C# and i only got Unity free. i'm working on a school project and we got no idea what we are doing mostly, anyway i'm trying to make a security camera in the game that shows another location in the level on a monitor, kind of like this the sits at the desk and has 5 monitors below him that show other areas of the level. now i can get the textures to render on a plane but i cant assign the texture to a specific camera so it only shows the player cam. me and my friends are willing to learn because we need this script because its a major part, any suggestions are welcome even if it requires a different script. this is where i found the script but i have no idea what it does really. http://pastebin.com/Qvw01kcM
  21. Hello friends! First thing first, I may sound like a complete idiot with what I say/ask because of me being so new to unity, done a little c# but next to no help trying to implant it into my little game! ANYWAY! In the game I'm making I want to implant both first and third person perspective on the character allowing you to move around, look around corners, lean left to right, shoot, crouch, prone, vault etc.all realtime and looking natural as possible! if any of you are familiar with DayZ you'll know perfectly well what I am talking about! but I have no idea how to do this! and all the tutorials I've watched up to now just show me how to make arms, and just arms! doesn't exactly look right in third person with arms just floating about! I'm wondering the process behind doing what I need as I'm still not sure exactly how you can make a model for both and animate it for both. I can provide more details upon request, thank you for reading! anyone who guides me through the logic and shows me it is possible, I will buy them a cookie! a real one! with chocolate! -arozock
  22. Hi, Is it possible to cut/put a hole through the centre of a filter effect applied to the camera so I can see through? I purchased the Camera Filter Pack from the asset and I'm using one of the filter effects on the camera and would like to put a hole through it faded at the edges if possible, as I have no clue about writing/editing shaders any help, advice would be appreciated, thanks.
  23. zeppeldep

    camera going thru

    The plan is two make this available on PC only. Use keyboard to control the helicopter, use mouse to orbit view about helicopter. Problem: The camera is going thru the terrain, it will probably also go thru all meshes Video here shows current nasty... http://youtu.be/SeV_P2RaMoo Here is the scene showing the assets connected to the camera... https://www.dropbox.com/s/s3my1v54oem2gsx/terrainthru.PNG Here is the code .. check the attempts I have made (very badly) .... using UnityEngine; using System.Collections; public class CamMouseOrbit : MonoBehaviour { public Transform target; public float distance = 10.0f; public float xSpeed = 5f; public float ySpeed = 2.5f; public float distSpeed = 10.0f; public float yMinLimit = -20.0f; public float yMaxLimit = 80.0f; public float distMinLimit = 5.0f; public float distMaxLimit = 50.0f; public float orbitDamping = 4.0f; public float distDamping = 4.0f; private float x = 0.0f; private float y = 0.0f; private float dist; void Start () { dist = distance; Vector3 angles = transform.eulerAngles; x = angles.y; y = angles.x; // Make the rigid body not change rotation if (rigidbody) rigidbody.freezeRotation = true; } void LateUpdate () { if (!target) return; Vector3 oPos = transform.position; x += Input.GetAxis ("Mouse X") * xSpeed; y -= Input.GetAxis ("Mouse Y") * ySpeed; distance -= Input.GetAxis ("Mouse ScrollWheel") * distSpeed; y = ClampAngle (y, yMinLimit, yMaxLimit); distance = Mathf.Clamp (distance, distMinLimit, distMaxLimit); dist = Mathf.Lerp (dist, distance, distDamping * Time.deltaTime); transform.rotation = Quaternion.Slerp (transform.rotation, Quaternion.Euler (y, x, 0), Time.deltaTime * orbitDamping); transform.position = transform.rotation * new Vector3 (0.0f, 0.0f, -dist) + target.position; // Vector3 newPos = transform.rotation * new Vector3 (0.0f, 0.0f, -dist) + target.position; // newPos.y = Mathf.Clamp(newPos.y,Terrain.activeTerrain.SampleHeight(oPos),0.5f); // transform.position = newPos; // float dist1 = newPos.y - Terrain.activeTerrain.SampleHeight(newPos); // // if(dist1 < 0.5) // { // newPos.y = newPos.y + 0.7f; // } // transform.position = newPos; // Vector3 wantedPosition = transform.rotation * new Vector3 (0.0f, 0.0f, -dist) + target.position; // // //Vector3 bumperRayOffset; // Vector3 back = target.transform.TransformDirection(-1 * Vector3.forward); // RaycastHit hit; // // //if (Physics.Raycast(target.TransformPoint(bumperRayOffset), back, out hit, 2.5f) // if (Physics.Raycast(target.position, back, out hit, 2.5f) // && hit.transform != target) // ignore ray-casts that hit the user. DR // { // // clamp wanted position to hit position // wantedPosition.x = hit.point.x; // wantedPosition.z = hit.point.z; // wantedPosition.y = Mathf.Lerp(hit.point.y + 1.0f, wantedPosition.y, Time.deltaTime * 5.0f); // } // // transform.position = Vector3.Lerp(transform.position, wantedPosition, Time.deltaTime * 5.0f); } float ClampAngle (float a, float min, float max) { while (max < min) max += 360.0f; while (a > max) a -= 360.0f; while (a < min) a += 360.0f; if (a > max) { if (a - (max + min) * 0.5f < 180.0f) return max; else return min; } else return a; } } Please help ... : ( We will braai together when all this comes thru .. : )
  24. Arozock

    General camera features in game.

    Hi guys! I'm trying to get some resources and help on how I can accomplish the features I want in this project i'm currently doing. First Feature, is the camera follows the crosshair in the middle, but the crosshair needs to stop at a minimum of a 180 degree cone in front the the player so the player is always viewable from the back, but the character will follow and strafe the aim of the crosshair, so WASD would be used to move in the directions, but the mouse could also shift the player in that direction too. Its kind of hard to explain, but thats the only way I can explain it at the moment, I guess some references would be fallout 3/nv, oblivion type control, but more realistic and not running diagonally forwards. The second is the view from fallout 3/nv-postal 3, where the character is more on one side of the screen and can transform to the other side and the true middle view. Thanks as always guys!
  25. meone

    Camera moves off the terrain

    Hello, When camera is near to the terrain, it moves off the map. What is the script I should insert to prevent the camera from moving off the terrain?
×