Hello I’m really new to JS and i need help trying to a multi spawn point but I really don’t know how?
My aim is, when you jump onto a platform it will change your spawn so if you fall off and die it will take you there instead to the start of the level!
My games a simple ball game btw!
Thanks and sorry if this is the wrong forum
-Beats
My approach would be to just define all the Spawnpoints there are in that particular level, put them into a sorted list and when reaching a certain point changing the (previously defined) ID of the spawnpoint to be used. Next time the player dies instead of telling the one Spawnpoint there is to spawn, you tell Spawnpoints[currentSpawnPointID] to spawn. Hope that was understandable.
Cheers
Thanks for your reply, I sort of get what you’re getting at and it makes sense but do I have to do to set spawn-points?
Should I make a var for a spawn-point? sorry I’m really new to coding also once again Flash thanks for your help
You could always create Empty Game Objects and call them ‘SpawnPointX’. Then once you get within a certain distance of a given spawn point, that will now be where you spawn after you die.
hi i need a little advice on spwanpoint as the problem is when i change the height of the checkpoint the spown point height remains the same what should i do ?
Is it a problem? What makes you think that it should? Because if you don’t have any particular reason to expect this then it’s not really a problem when what happens is exactly what you’d expect to happen.
There’s no such thing as Spawpoint or Checkpoint in Unity Engine or Editor. How are we to help you with something we know absolutely nothing about? I for one have no crystal ball.
What is Spawnpoint?
What is Checkpoint?
How are they set up?
EDIT: Also, how does that relate to original topic of this post?
If you asked me to remotely fix your car engine and I explained that I don’t know anything about the engine you happen to have would you reply to me that it’s the kind of engine that makes a car go?
I’m afraid I will need more details that that to have any idea what we are talking about.
Let me present you with similar problem:
I have a game. It’s FPS game and it doesn’t work. Can you help me?
i get your point.i am making a 2d game and using my prefab to save my time as you know point is just a point …
var spawnPoint : Transform;
function OnTriggerEnter(other : Collider){
if(other.tag == “Player”){
spawnPoint.position = Vector3(transform.position.x, spawnPoint.position.y, spawnPoint.position.z);
//Destroy(gameObject);
}
} here is a script to give you an better idea what i a trying to do
OK. Let’s try this from the other end.
If you want your spawnpoint to resize when you resize your checkpoint it would have to be setup this way specifically.
One way would be to have the checkpoint GameObject be a child of spawnpoint GameObject. Chilrden reside in parents local space so resizing parent will also resize children.
Another way would be to have a script as spawnpoint GameObject Component that sets it’s size according to size of another GameObject - checkpoint in this case.
There are probably several other ways of achieving this.
So let me repeat my question: What makes you think that your spawnpoint should resize when you resize checkpoint?
If you don’t have any particular reason to think that then it’s not really a problem - it’s working as expected.
it worked thanks. one more problem … why the vertical height don’t change of the spawn point after referring that to the checkpoint … as the scene gaining it vertical height ?
LIKE THE SPAWN POINT is just follows the horizontal change with the check points but when i change the vertical height of the check point the spawn point only follows the horizontal length not the vertical
How do you change spawn point size based on checkpoint in the first place?
If through GameObject parenting then what you say shouldn’t happen.
Perhaps spawn point has a script that mingles with the size.