Moving an actor in a particular axis - not working?
Karim_S
United KingdomMember Posts: 19
Hey guys,
So I have an off-screen spawner which I programmed to spawn actors in random directions all over the screen, only I need them to spawn vertically though still at random points in the y axis. I've tried constraining the attribute of the off-screen spawner from self position y to self position y and even changing the attribute on the spawned actor itself but it doesn't seem to work.
Note: I already have the equation set up for spawned actors at random locations within the iphone landscape dimensions.
I'm sure it's a simple fix, any help would be great.
Thanks in advance.
Comments
Is your question about the position of the spawned actor or about the movement of the spawned actor? What is it you're trying to do?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
The movement of the spawned actor, seen as they duplicate I'm trying to spawn them along the y axis at random...
Anyone?!?
I had a similar issue that I worked out with tatiang. At least I think they're similar. Find the coordinates on the Y axis that you want them to spawn on, and use a random function of the min Y and the max Y you want them to spawn on.
Spawn x=whatever you want / y=random(lower value,upper value)
I'm still unsure of what you're asking. It seems the spawned actor isn't moving the way you want and the spawn location is incorrect?
Can you post a screenshot of the Spawn Actor behavior and a screenshot of the Move or other behavior in the spawned actor? You'll need to upload them to a file-sharing site and then post the download links here.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
I already have the coordinates set to the iPhone landscape dimensions, as follows:
Spawn Actor
random(0, 568) to random(0, 320)
I tried adding the random min y and max y both with and without specifying coordinates, yet it didn't work?
How would I add this in an equation?
Please break it down more simply. Furthermore do I need a new attribute for this?
My game is a shooter, the playable actor is positioned to the far left and the enemies to the far right, I'd like to set a margin for their spawning (approx up to mid-screen) beyond which they cannot spawn so that the player can see them coming as opposed to them just appearing in his face at times.
I have an off-screen spawner, the rules I set are as follows:
Timer
Every 1 second
Spawn Actor: Enemy
Place: In front of actor
In the direction: 0
Relative to: Actor
From position: random(0, 568) to random(0, 320) relative to: scene.
I'm using the windows GS just so you know.
I'm not too familiar with file sharing, my apologies.
wouldn't you be keeping the x value static? Otherwise they are spawning all over the map?
Or maybe I am misunderstanding where you want them spawned.
Based on your code above, the entire screen is a valid spawn point
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
Please break it down more simply. Furthermore do I need a new attribute for this?
A screenshot is needed to see if there are any mistakes being made.
Do you know how to take a screenshot ?
I tried this but it doesn't seem to work
How do you mean keeping the x value static?
Yes the whole screen is the current spawn point, however I wish them to spawn from no further than the vertical halfway mark of the screen to allow the player to see the enemies coming rather than them spawning too close.
file sharing is the issue, are you saying I can just screenshot and upload directly? If so I'll try get one up.
Sorry for the delay in responses btw
'It doesn't work' as a piece of feedback is not much use, it could mean anything at all.
Try Tinypic.com, it's pretty straightforward to use.
Then you Want to change your spawn value to random(284,568) instead of (0,568)
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
Sorry, you're right that feedback wasn't helpful.
So the actors just suddenly started popping up when I tried this, there was no gradual smooth spawning/movement, and it wasn't apparent whether it restricted them to the halfway mark or not.
I will try jonmulcahy's suggestion and keep posted.
How about the (0, 320) part of the equation, do I change this aswell or leave as is?
the 0,320 part is allowing your actor to spawn on any pixel from 0 to 320, which is the absolute bottom to the absolute top.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
It worked! Thanks for your help guys