enemy bullets shoot at player, but not track?
I've been playing with the various move/change velocity behaviors but i can't find a setup that allows my badguys to shoot at the goodguy and just have the bullet move straight to the goodguy's location AT the time of the shooting. If I constrain it to his location, it just tries to follow him instead of moving straight off the screen.
I've tried 'move' 'move to' 'change velocity' and 'accelerate'.
How would I do this?
I've tried 'move' 'move to' 'change velocity' and 'accelerate'.
How would I do this?
Comments
And tried to follow the instructions. I do have attributes constraining the players x and y loc.
I tried the vectortoAngle with Accelerate Toward. Result was when bullet spawned, game froze.
With Accelerate, Move, Change Velocity, result was bullet went upwards, even if player was at the bottom.
What I'm not sure of is this line "vectorToAngle(Actor1.X - Actor2.X, Actor1.Y - Actor2.Y)".
am I supossed to put all that information into 1 E input? like under the Behavior Move? Or under a Behavior that has 2 E's for an x and y location, like Move To?
I ask because I've tried both options and neither of them produce the result i'm looking for.
Ideas?
Use "Rotate too Position" which will be your target position then set speed 600 uncheck "run to completion" and check "stop on destination"
Use a "Timer" set at "after 0.25" then a "Move" Rule will send projectile toward target.
This is how I did it Hope This Helps.
But it's still tracking the player
In the 'Move' behavior i have direction-0, relative to actor, move type additive, speed 300
When it starts to move, it moves at direction -0 which in degrees is straight to the right.
so even if my player is on the left side of the screen, and badguy on the right, the bullet will turn in place to face the player, then shoot out of the badguy in the opposite direction, then slowly turn at an angle and eventually come back and hit the player.
Maybe I'm not understanding when you say 'no direction'. The field to type into is a 360 degree range of motion measured with a numerical value. How do I tell it 'no direction', or 'straight ahead the direction you happen to be facing'?
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
this way the current player position can move, without effecting the position that the bullet is firing to.
oh and for this i'd just use 'move to'
but one problem. The bullet moves to the players position that it recorded and stopped, but using the Accelerate Toward instead of Move To allows it to keep going.
but one problem. The bullet gets to the edge of the screen and starts moving back towards the badguy that fired it, so it goes from a missile to a boomerang lol
the only movement behaviors that have both coordinates are move to and accelerate toward and one stops the bullet the other has it return from whence it came
Any more ideas?
I can't destroy it when it reaches its destination because that wouldn't make sense if someone shot a bullet at the player and the player moved the bullet reached where he was and just disappeared, it has to keep going.
I can't believe we can't just have a bullet move across the screen where the player was and just keep going. Every space shooter ever made has this lol.
There has got to be a way.
There has got to be a way to just tell an actor to 'move forward', which ever direction it's facing.
use "Rotate to position" put in the X,Y position blocks Put your "game.yourtrackingattribute and game.yourtrackingattribute attributes's "aka what ever you named them target x and target y is what I call mine. speed 600 is what I used. "relative to SCENE"
"run to completion is unchecked", "stops on destination is checked".
I used a Timer Rule set for after 0.25 checked run to completion" with a Move Rule speed 300 "Relative to Actor", Direction 0 "move type stacked"
This worked perfect for my game not saying there is not a easier way but worked for me.
and it works perfectly....wonder what part i missed the first time. I had to have missed something. BBEnk, thanks man, you just saved my sanity lol.
in Your bullet actor. At the Very Top you need to change attbibute behaviors
-Change attribute self.target.X to game.Player.X
-Change attribute self.target.Y to game.Player.Y
then if you are using vector to angle to determine your move the expression would look like this
VectorToAngle(self.Position.X-self.target.X,self.Position.Y-self.target.Y)
If you using say move to and need a position instead of angle you just have to use self.target.X and self.target.Y as the positions.
The issue you are having is you are using a game attribute that is constrained to a value that is always changing meaning if the player moves then the values change and the direction of the move updates. Which is great if you are firing a heat seeking missile. But not so much for a bullet.
Good Luck