About shooting.
AleksandrGames
Member Posts: 54
I know how to make an actor shoot an other one, but here is my problem. Both the bullet and the main actor are accelerating. which means if i shoot a bullet the bullet lags behind. if i change the bullet from accelerating to moving, then the main actor will accelerate past the bullet even faster, which makes it even worse. How do i make the bullet constantly moving faster than the main actor even from the start?
Comments
change attribue
self.motion.linearvelocity.x to 500(or whatever speed you want)
if that doesn't work, you could also try...
Make a real attribute called PlayerSpeed
In the player...
constrain attribute
self.motion.linearvelocity.x to game.PlayerSpeed
in the bullet
constrain attribute
self.motion.linearvelocity.x to game.PlayerSpeed+300(or whatever speed you want)
Agreed, I was about to post the same basic idea, simply add the player's speed to the bullet's speed - so that the bullet moves at a constant speed in relation to the player.
One small point, you have this rule back to front:
constrain attribute
self.motion.linearvelocity.x to game.PlayerSpeed
It should read:
constrain attribute
game.PlayerSpeed to self.motion.linearvelocity.x
Thanks!