Convert c# to Js?
Hello, I have this C# script. Can someone translate it to Js? I'm afraid I can't do it myself :( // calculate desired camera position Vector3 position = target.position - (rotation * Vector3.forward *...
View ArticleSoft first person interaction with rigidbodys.
I have an interaction script on my first person controller. The script sends out an Raycast to detect objects that are interactable. If the object can be picked up and held in front of the player it...
View ArticleAccessing colliders, in if statement
Hello! Just to be clear i am using **Javascript**. I have been working on trying to detect if my mouse has clicked on a specific collider if it is clicked on that specific collider. heres my code: var...
View ArticleProblem in Shooting Accuracy
Hello everyone i got Problem in Shooting Accuracy using Raycast Here is The Script : var hit: RaycastHit; if (Physics.Raycast(SpawnPoint.position, SpawnPoint.forward, hit)){ var delay = hit.distance /...
View ArticleStop player movement if it's Raycast hits an object
I have the debug for my raycasting, and it all seems to work as intended. Now all I need is for the Player to stop moving forward if the Raycast hits another object. Can I get examples or links to the...
View ArticleCubecasting?
Is there any way to raycast a cube? I know you can raycast spheres and capsules, but is there a way to do cubescasts?
View Articlecheck release mouse with raycast
How can I check if a Raycast has already hit an object? What I want to do is that when I click on a sphere is increased the strength to launch (to simulate a shot at the basket) but I can click only 1...
View ArticleEteeskiTutorials' bullets (raycast bullets with gravity)
Hi, for my game I used EteeskiTutorial's bullets from one of his series ( http://www.youtube.com/watch?v=kx7PcUzhG_8&list=PLfAMZpOjTmpbr9EN9FwK76Hdr_bWMDxdH ), I only used the tutorial [1/5] though...
View ArticleWhy do my bullets only destroy themselves sometimes after colliding with the...
if (Physics.Raycast(myTransform.position, myTransform.up, out hit, range) && expended == false) { //if the collider has the tag of Floor then... if (hit.transform.tag == "Wall") { expended =...
View ArticleGUI.button and onClick Terrain
I'm developing a 2D "Shoot'em up" game where my main character is stationary on the left of the screen and shoots where ever I click on the screen(using raycast). I have a pause button on the bottom...
View ArticleWant to find the point straight below the controller
Hello, In the following code I have assigned the target to be the FirstPersonController, and that much appears to work (the distance to ground thing works okay). However, I want the magenta line to...
View ArticleHelp destroying gameObject on RayCastHit?
Hey all, This is my first time using raycasts and I'm a total noob at it. I'm sorry for rookiness, but please try to be patient as I've been trying to figure this out forever now. Haha! So here is what...
View ArticleHow expensive is Overlapsphere than a few raycastings?
Hi All, That's the basic question, But if anyone has teh inclination to read teh background.. here it is.. My starting point is the 3rd person controller from 3dbuzz tutorials, with a lot of my own...
View ArticleHow can I get a character to patrol and follow terrain?
I've seen many forum posts and answers related to parts of this question, but I can't seem to get it to work together properly. I have a character that I want to patrol waypoints and follow the terrain...
View ArticleWhat does physics casting actually do?
I have been messing around with different aspects of physics casting mainly sphere. My original understanding of it was that it castes a sphere from an origin using that origin as a center of a sphere....
View ArticleRaycast direction problem
Hi! I am trying to get mye raycast to change its direction. Vector 3 direction = transform.forward; direction.x += (Random.value - 0.5f) * spread; direction.y += (Random.value - 0.5f) * spread;...
View ArticleRaycast firerate shooting
i have a raycast that shoots too fast i need to incorporate a firerate into it. i am a noob and i have spent an hour trying to fuse them together. if anyone could fuse them and help me out i would...
View ArticleHelp Playing "Sound Clip" on RayCastHit? (RayCast help?)
Hello, I am currently learning how RayCasting works and I need some help/example scripts. (I use Java.) Basically, I am using this script below to create a "RayCast" in front of my player. I am trying...
View ArticleAI avoidnace Enum + Raycast, casters not working on some states
Hey guys. Started to play with Enum to set the state of my AI and keep my code readable - but I'm having a few problems. I have a slight idea as to way, but wanted some input from some gurus. I'll try...
View ArticleUnity Android Movement Problem
Hi. This is a my script: var player : Transform; var point : Transform; function Update () { if (Input.GetButtonDown ("Fire1")) { var ray = Camera.main.ScreenPointToRay (Input.mousePosition); var hit :...
View Article