Spawning USurvival Items

Announcements, support questions, and discussion for Quest Machine.
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Spawning USurvival Items

Post by Tony Li »

Hi Nathan,

I have a suspicion that using Variable["QUESTGIVERID"] will work. If not, let me know.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Spawning USurvival Items

Post by nathanj »

You were correct. I should have thought of trying that. Everything is working now

Thanks Tony!
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Spawning USurvival Items

Post by Tony Li »

Always glad to help!
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Spawning USurvival Items

Post by nathanj »

That was the first time I'd used the global search and replace!!!

Such an awesome feature.

Nathan
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Spawning USurvival Items

Post by Tony Li »

Nathan,

Please give this network-aware spawner a try: QM_MirrorSpawner_2019-03-29.unitypackage

Replace your Spawner component with ServerSpawner. It will automatically add a helper component named ServerSpawnerHelper.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Spawning USurvival Items

Post by nathanj »

Hi Tony

Sorry for the delay.

Just tested this and the good news is it generates items that can be collected! However, I'm struggling with how to get the spanwed items to fall or snap to the terrain - it works on a flat terrain but as soon as there's height variance it becomes problematic. If I add a Rigidbody to the collectable item it falls through the terrain - I've tested all the physics settings and there's no reason for this behaviour. Is it possible that there is an issue between the client and the server registering the Rigidbody object.

I'm not even sure a Rigidbody is the solution here. Would there be a way to implement a raycast detection of the terrain to snap the item when it is generated? Or, am I at this point moving into too niche of usage? We could implement on our end but if it's not too difficult might not be a bad feature of the spawner.

I hope this helps and thanks again for this!

Nathan
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Spawning USurvival Items

Post by Tony Li »

Hi Nathan,

Make sure it has a collider that's not a trigger, and that it's on a layer that collides with world geometry. I'm not sure how this will play with ItemDrop detection, though. You may need a custom ItemDrop script. For example:

- Parent object: Layer:Default, Box Collider (not trigger), Rigidbody,
- Child object: Layer:ItemDrop, Box Collider, custom ItemDrop script that destroys the parent object.
User avatar
nathanj
Posts: 303
Joined: Sat May 28, 2016 12:30 am

Re: Spawning USurvival Items

Post by nathanj »

:facepalm:

The box collider was set to “is trigger”. I’m sorry for wasting your time again.


Nathan
User avatar
Tony Li
Posts: 22143
Joined: Thu Jul 18, 2013 1:27 pm

Re: Spawning USurvival Items

Post by Tony Li »

No worries! Glad it's working now.
Post Reply