Shoot fireball once in unity C#


I made a script for shooting fireballs from a cannon, but when clicking once the cannon shoot 3 or 4 balls! do you know guys how to shoot 1 ball per 1 click?

Here's my script:

public class CannonScript : MonoBehaviour {

    public GameObject CannonBall;
    public float FirePower;

    // Use this for initialization
    void Start () {


    // Update is called once per frame
    void FixedUpdate () {
        if(Input.GetMouseButtonDown(0)) {
            Instantiate(CannonBall, transform.position, transform.rotation);
            CannonBall.GetComponent<Rigidbody>().AddForce(0, 0, FirePower);


You should use Update() for that, not FixedUpdate(). The truth is that FixedUpdate() should be strictly used for physics calculation, specifically when you are working with Rigidbodies.

Recent Tips

  1. Adding a table of contents to a Microsoft Word Document using vbs
  2. Change locale in android app (onto Hindi)
  3. How do I stop selenium automation if 20% or 1st 20 test cases test methods are failed?
  4. Sharepoint with silverlight app
  5. What's the best way to write robots.txt for github pages using multiple repos?
  6. Biopython: Cant use .count() for biopython
  7. How can I find out the token balance of an address?
  8. ref value is undefined in vue (modal, textarea, $refs)
  9. Azure - HDInsight Hbase Data Insertion Failed
  10. SignalR overwriting OnConnected(), OnDisconnected()
  11. DatePickerDialog displays with two borders
  12. "type 'double' is not a subtype of type 'int' in type cast" error in flutter. What should i do?
  13. hiding the autocomplete list when user click outside the textbox is not working as expected
  14. JSF IceFaces basic problem with redisplaying input value
  15. How to validate material ui TextField in reactjs?
  16. Go and MongoDB connection won't work with panic log "no reachable server"
  17. WordPress Posts Pagination Not Working
  18. F# sprintf won't print in interactive console
  19. Spring Integration get FTP files recursively with outbound-gateway
  20. Jade mixins not getting working from external file
  21. Can not access defined exports from the webpack bundle?
  22. Completely new to Node.js - API Programming
  23. Formatting Compare-Object Ouput
  24. Add dynamically added textbox value from User Control to main form
  25. Create a ByteBuf in Netty 4.0
  26. Is it possible to do computation before super() in the constructor?
  27. Q-learning Updating Frequency
  28. Wrong reload order when using Gulp and browserSync
  29. I use hugo build static page. But don't have content
  30. How to change background color and set bar colors based on conditional formatting in VBA?