|
Normal crosshairs that are 2d images on the HUD are good, but dont work well because sometimes if you shoot close or far, the bullet doesnt shoot where the crosshair says it will, this is very frustrating and hard to bypass. I need some type of code that makes the crosshair move slightly to ensure that the bullet will hit where the crosshair is. A good example is in Half-Life: 2. If you aim down a hallway and then look at a wall right next to you, you will see what I mean.
(comments are locked)
|
|
I would it do this way:
I have no idea how, I am fairly new to Javascript. I know the basics
Aug 04 '12 at 02:10 PM
jjj51
When you know the basics, where is your first problem. Raycasting? function Update(){ var ray : Ray = Camera.main.ScreenPointToRay (Input.mousePosition); var hit : RaycastHit; var rayLength = hit.distance; This code sends a ray from your camera to your mouse.position a rayLength is then your distance.
Aug 05 '12 at 08:03 PM
RickTick
(comments are locked)
|
