PlayMaker Help & Tips > PlayMaker Help

Prefab Spawning Under Spawn Position. [SOLVED]

(1/2) > >>

MaskedPixel:
I am instantiating a prefab in a way nearly identical to the Throw Grenade Example.  The only differences are the spawn position GO is attached to the capsule instead of a Main Camera as this is third person view and there is no FSM on the grenade.

It starts out spawning in the right position and the grenades fly off into the distance.  Then the spawns keep getting lower and lower until they spawn inside the floor even though the y-value of the spawn position GO never changes and there is plenty of room between the spawn pos and the capsule.  I have no idea what I am doing wrong...

Any suggestions/ideas are appreciated...

iHaveReturnd:
Does your spawner object have a collider on it?  It could be colliding with the grenades when they spawn and pushing the spawner down each time.  I had a problem like that with a past project.

Based on how you described it I don't think that's the problem but its something to double check.

You might be able to add a rigid body to it if it doesn't have one, and go to constraints in the inspector window and lock the y position.

If that doesnt work, a work around would be to make it set its y position relative to the capsule everytime it fires though that certainly wouldn't be the most efficient thing.

Sorry I don't have a more concrete answer but I can't tell what would be causing it unless its a collision, FSM, or script attached to it or a relating object.

MaskedPixel:
Thanks for the suggestions.

I double checked that the spawn location was far enough from the capsule by moving it to where it is nowhere near anything else.

Also, I added a rigid body and locked the y value.  The problem persists.

I don't actually know how to make the prefab spawn at a position relative to the player but I am imagining that that isn't going to make a difference.

Maybe rebuilding everything from scratch will allow me to get it right...

MaskedPixel:
So this just got rebuilt from scratch and it works great.  I deleted the other scene already so I don't know what I was doing wrong previously, otherwise I would post it here...

SirNikkolas:
I had the same problem. Rebuilt it, and it stopped. Idk why it happened the first time, and I have not been able to replicate it. Idk I guess its just a random bug.

Navigation

[0] Message Index

[#] Next page

Go to full version