Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Collider Trigger?

Discussion in 'Scripting' started by stuthemoo, Jan 6, 2006.

  1. stuthemoo

    stuthemoo

    Joined:
    Sep 17, 2005
    Posts:
    182
    Hi,

    I'm having a bit of problems trying to write a script;

    When a ball in my game passes through a trigger collider I want the ball to get bigger just a little, say '1.3' x bigger.

    But I can't work out the code, any suggestions?

    Thanks,
    Stuart
     
  2. Bampf

    Bampf

    Joined:
    Oct 21, 2005
    Posts:
    369
  3. stuthemoo

    stuthemoo

    Joined:
    Sep 17, 2005
    Posts:
    182
    Yes, I meant scaling of the ball and I have tried what you said
    but when I do that the thing the ball hits gets bigger
    not the ball...:?

    Thanks
     
  4. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    Code (csharp):
    1. function OnTriggerEnter (other : Collider)
    2. {
    3.     other.transform.localScale *= 1.3;
    4. }
    (untested :) )
    -Jon
     
  5. aaronsullivan

    aaronsullivan

    Joined:
    Nov 10, 2005
    Posts:
    984
    What kind of game are you making?

    Sounds like Snowball. ;)

    :eek:
     
  6. stuthemoo

    stuthemoo

    Joined:
    Sep 17, 2005
    Posts:
    182
    :eek:

    H-H-H-How did you know the name of my game?

    Stu
     
  7. aaronsullivan

    aaronsullivan

    Joined:
    Nov 10, 2005
    Posts:
    984
    See my avatar? I've already made it. :)

    http://homepage.mac.com/aaronsullivan/projects/snowball.html

    I entered it in uDevGames 2004 and it did decently, placing in the top 3 in a couple categories.

    I am actually planning on making the sequel using Unity. :D

    Sadly, the formation-games.com site that the game links to is temporarily offline. :(

    My game uses the idea of rolling over snow patches making you larger and it plays into the game eventually. Your description of what you wanted to do sounded suspiciously similar. Feel free to try it out. (there's a download link on that page.)
     
  8. stuthemoo

    stuthemoo

    Joined:
    Sep 17, 2005
    Posts:
    182
    Hi,

    If your thinking I'm copying you, I'm not.
    Like in my game you roll through snow coming out of fake snow makers.

    Thanks,
    Stu

    P.S I wouldn't copy you. :D
     
  9. stuthemoo

    stuthemoo

    Joined:
    Sep 17, 2005
    Posts:
    182
    I tried out your game, it's good but your
    game and my game are nothing alike.

    Thanks,
    Stu
     
  10. aaronsullivan

    aaronsullivan

    Joined:
    Nov 10, 2005
    Posts:
    984
    Not to worry, I never suspected you knew anything about my game. Few do. I just wanted to alert you to a possible conflict there. :D
     
  11. Bampf

    Bampf

    Joined:
    Oct 21, 2005
    Posts:
    369
    Snowball rocked.

    Stu, recommend you rename your game. Even just a little change might suffice, e.g. Snowballin' or Snowballer. Then google it and see if it's been used before for anything notable.

    Good luck,
    Matt
     
  12. aaronsullivan

    aaronsullivan

    Joined:
    Nov 10, 2005
    Posts:
    984
    Bampf, thanks for that. :)

    Stu, since part of our brains are the same wavelength, it never hurts to be cautious: Rollo is the name of the snowball character. ;)

    I'm curious about your game now, though! I suppose I'll have to wait like everyone else. Can you guys sense that undercurrent of impressive (yet still invisible) Unity games? I can't wait till some of these break out into the public.
     
  13. klindeman

    klindeman

    Joined:
    Jun 13, 2005
    Posts:
    295
    The final version of Open Fire should be released soon. I am thinking about maybe doing it shareware now, since I showed it to David at Macworld today and he seemed impressed. If I do that, the release will be delayed shortly :p
     
  14. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
    delay it and go for it! :tu:
     
  15. guategeek_legacy

    guategeek_legacy

    Joined:
    Jun 22, 2005
    Posts:
    659
    Awsum we got support on that idea I'm all for it too! Jeff