Shoot with mouse help please?

SongSmithSongSmith Member Posts: 10
edited September 2012 in Working with GS (Mac)
I have a click and shoot in my game where the bullet goes in the direction like T shirt booths video but I wanted it to keep travelling in that direction. How can I do this?

Comments

  • RPRP Member Posts: 1,990
    Are you speaking of a bullet that is constrained to the mouse position when fired, or a bullet that continues traveling as it destroys /or does not collide with anything in its path?

    Post what vids you are referencing, there are a ton of vids out there. Once we know how you expect it to behave, we'll get you squared away.
  • RPRP Member Posts: 1,990
    edited September 2012
    FUS RO DUH....
    @Mods: See the trend here?

  • SongSmithSongSmith Member Posts: 10
  • RPRP Member Posts: 1,990
    Geez, had issues logging in since yesterday.

    So, what it looks like you need to do is not use the Move To position. This is what is locking your bullets to that position. Rather, use a move or accelerate behavior in conjunction with a constrain behavior (to keep it on that path).
  • SongSmithSongSmith Member Posts: 10
    I tried it but it didnt work, sorry took me so long to reply as I had problems logging in.
  • SongSmithSongSmith Member Posts: 10
    Can anyone help me with this? It's the only thing stopping my game from getting finished. Thanks
  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    edited October 2012
    Using two actors: gun & bullet

    In the gun actor:
    When mousedown
    -- Spawn Actor
    ---- Actor: Bullet
    ---- Layer Order: In front
    ---- Direction: vectorToAngle(game.Mouse.Position.X-self.Position.X, game.Mouse.Position.Y-self.Position.Y)
    ---- Relative to: actor
    ---- Position: >0 ^0
    ---- Relative to: actor

    In the bullet actor:
    Change Velocity
    -- Direction: 0
    -- Relative to: actor
    -- Speed: 300
  • SongSmithSongSmith Member Posts: 10
    Its continuing past the point I clicked but changing direction from the angle I clicked and go right instead.
  • SongSmithSongSmith Member Posts: 10
    Thanks guys but I just can't seem to get it to work still
Sign In or Register to comment.