need help with shooting....

johnydeejohnydee Member, PRO Posts: 196
edited April 2012 in Working with GS (Mac)
i have a problem with my character shooting.i need it to shoot the way it faces.right now it only shoots forward.So how do i get it to shoot the way its facing?

Answers

  • RPRP Member Posts: 1,990
    This issue with the bullet actor. You need to change the direction it is heading. double click on your bullet actor and use a accelerate or move behavior. Set the direction in the realm you wish the bullet to travel. Left is 180 and right is 0.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2012
    To spawn an actor in the direction that the spawning actor is facing, use 90° relative to actor, assuming you want the bullet to come out of the top of the actor. Adjust the angle depending on where you want the bullet released. Then, on the bullet actor, it usually works to move the bullet 0 relative to the actor. I have a video that explains this:

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • johnydeejohnydee Member, PRO Posts: 196
    ok thanks gonna go try that
  • johnydeejohnydee Member, PRO Posts: 196
    the method dosent work.I think the reason is that the rocket rotates and My character changes images for the up,down,left and right positions.Its starting point is facing right so when i shoot it goes straight.Now if i go left it changes the image for the "facing left".Now when i shoot it goes backwards in the direction of its start point.So how can i fix this?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @johnydee187 You could either actually rotate the actor instead of changing images, or you could have separate conditions (When [changing image to left] spawn bullet 180°; When [changing image to right] spawn bullet 0°; etc.).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • johnydeejohnydee Member, PRO Posts: 196
    yeah when i had posted that comment 10 min later i realized i should just rotate it instead hahaha...so ill try that
  • johnydeejohnydee Member, PRO Posts: 196
    ok so i got the shooting to work right.But when i preview the scene my actor shoots a round automatically without me hitting the fire button.why does it do that?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Do you have a bullet actor on the scene? Go to Scene-->Layers and look in your layers to check for that. If you don't, post a screenshot of your actor's rules.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • johnydeejohnydee Member, PRO Posts: 196
    no i dont have a bullet actor on scene.I just have the rules when (fire button) is pressed change the attribute to true,otherwise false.in the charactor actor i have when(fire attribute is true) spawn the bullet actor.and in the bullet actor i have the "change velocity".its just like your video.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    If you don't, post a screenshot of your actor's rules.
    Do you have the Change Velocity behavior set to relative to actor or relative to scene? Also, if you put a different number in, such as 45 or 60, does it change the direction of the bullet to that angle?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • johnydeejohnydee Member, PRO Posts: 196
    i have the change velocity set to relative to actor.and i put a number in but didnt change the bullet direction.So iam confused here.i cant find whats spawning the bullet actor before i hit the fire button.it only shoots once automatically when i preview the scene.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    I really can't help you without screenshots or a game file. You're welcome (if you have Dropbox or want to use mediafire, etc.) to post a link to your game file and I can help you.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • johnydeejohnydee Member, PRO Posts: 196
    how do i post a screen shot on here?
  • johnydeejohnydee Member, PRO Posts: 196
    oh and the bullet was able to change direction when i put a number in...
  • johnydeejohnydee Member, PRO Posts: 196
    nevermind i figured it out...the problem was that in the boolean attribute, it was checked on.I guess somehow in someway it was making the attribute true at the start..
Sign In or Register to comment.