Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Oct 26, 2014 at 05:51 AM by robertbu for the following reason:

Duplicate Question

avatar image
0
Question by gtagamer · Oct 26, 2014 at 05:51 AM · gunrange

BCE0043 :Unexpected token: :.

hello this is my second time asking for help on this script this gun script had been driving me crazy could someone be kind enough to help me please.

p.s this is a raycast script

 #pragma strict
   
  var Range : float = 1000;
  var Force : float = 1000;
  var Clips: int = 20;
  var BulletsPerClip : int = 6;
  var ReloadTime : float = 5;
  var BulletsLeft : int = 0;
  var ShootTimer : float = 0;
  var ShootCooler : float =0.9;
  public var ShootAudio : AudioClip;
  public var ReloadAudio : AudioClip:
  
  function Start(){
  
  
  }
  
  function Update () {
      if(Input.GetKey(KeyCode.F)) {
          RayShoot();
      }
  }
  
  function RayShoot () {
     var Hit : RaycastHit;
  
     var DirectionRay = transform.TransformDirection(Vector3.forward);
     
     Debug.DrawRay(transform.position , DirectionRay * Range , Color.blue);
     if(Physics.Raycast(transform.position , DirectionRay , Hit, Range)){
     
     if(Hit.rigidbody)(
     
     Hit.rigidbody.AddForceAtPosition( DirectionRay * Force , Hit.point);
     
     
     }
     }
  
  
 }
 
  
   
 function Reload()(
 
   
 }
 
   
 function PlayShootAudio()(
 
  
    
      
 }
 
   
     
 function PlayReloadAudio()(
 
   
     
 }
 
        
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Oct 26, 2014 at 05:52 AM 0
Share

On lines 46, 52 and 61, you have a '(' when you should have a '{'.

And your error is likely one 12, where you have a ':' ins$$anonymous$$d of a ';'.

1 Reply

  • Sort: 
avatar image
0

Answer by AlwaysSunny · Oct 26, 2014 at 04:59 AM

Questions like this are unlikely to pass moderation or receive answers. You haven't described the problem you're experiencing, for one thing. Asking for "help on this script" is not sufficient.

I glanced over the code and spotted an error on line 33. There is a ( which should be a {

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

BCE0044: expecting (,found 'RayShoot' 1 Answer

A node in a childnode? 1 Answer

Timing Between each Gun Shot 2 Answers

Set npc to inactive when certain distance away from controller (script not working) 0 Answers

Animation & Script Help 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges