Projectile Help
by Christopher Jeske · in Torque Game Builder · 11/28/2011 (2:54 pm) · 13 replies
Hi, I'm wondering how I would use an image I made to be a projectile using behaviors. The shoot behavior has an option for this but won't let me put that static image there. Am I missing something?
About the author
#2
11/28/2011 (5:35 pm)
Yes I have, I have several in there
#3
11/28/2011 (10:48 pm)
I have them both imported as a static mesh but the one I'm using for a ship is animated, that is the one I would like the projectile to go to. Does it matter if it is animated or not?
#4
The projectile parameter is a t2dSceneObject so should work equally well with a static or animated sprite. I tested in 1.7.5 and it worked fine.
Are you sure you dragged the static sprite into the scene and gave it a unique name that does not start with a number?
11/29/2011 (6:03 am)
Are you using the Shoots behavior from here?The projectile parameter is a t2dSceneObject so should work equally well with a static or animated sprite. I tested in 1.7.5 and it worked fine.
Are you sure you dragged the static sprite into the scene and gave it a unique name that does not start with a number?
#5
11/29/2011 (12:08 pm)
I just tried that one also but it looks the same as the behavior in the engine. Still nothing is showing up under the drop down menu. I just import a static mesh and add the shoot behavior and then it should be in the drop down menu correct? I have some screen shots but it doesn't seem like I can post them here.
#6
So the behavior is adding correctly to your player but do you have a static sprite in the scene (dragged from the Create panel into the game) that is named properly to use for the projectile? You can't just reference the image map directly.
11/29/2011 (12:11 pm)
To post screen shots you have to host them externally and link using MarkupLite.So the behavior is adding correctly to your player but do you have a static sprite in the scene (dragged from the Create panel into the game) that is named properly to use for the projectile? You can't just reference the image map directly.
#7
11/30/2011 (11:59 am)
Ok this is what I did, I imported both my ship and my projectile as static images, then dragged them into the scene, clicked on my ship and chose the "shoots" behavior and thats where the drop down menu has nothing inside of it. Am I forgetting to do anything?
#8
11/30/2011 (12:03 pm)
Once you drag out the sprites, are you naming the projectile under the scripting section?
#9
11/30/2011 (12:25 pm)
Ok thank you very much, now there is my static mesh showing up in the drop box. However, now it is not shooting, I guess it will take more tinkering
#10
11/30/2011 (12:27 pm)
A common pitfall here is that the projectile collides immediately with the player when shooting. Do you have the sprites setup to send/receive collisions? If so, are they in separate collision groups?
#11
11/30/2011 (12:36 pm)
I put the ship on collision 0 and the missile on collision 1, both can recieve and send collisions. When I go to shoot the ship shifts to the side.
#12
Try turning on send/receive collision on the player.
Then turn on only send collision for the projectile (unlikely, it will need to receive).
Unless you need them for some reason, turn send/receive physics off on both objects.
Set them to different collision groups.
11/30/2011 (12:48 pm)
Sounds like they're still colliding. Try turning on send/receive collision on the player.
Then turn on only send collision for the projectile (unlikely, it will need to receive).
Unless you need them for some reason, turn send/receive physics off on both objects.
Set them to different collision groups.
#13
12/06/2011 (12:05 pm)
Still not shooting does it need the .cs file? It shouldn't since it's a behavior right?
Associate William Lee Sims
Machine Code Games