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?
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.
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).
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
Comments
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.
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).
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