Waves not instantiating relative to their moved positions

Hi there,

I have followed Rick’s directions exactly on the course for Argon Assault and adding multiple waves of enemies. The main difference is that I’m using the latest LTS build of Unity (2022.3.17f1).

My problem is, whenever I attempt to add a second instance of my wave, it still spawns at the same place as the first one. Is this feature not possible on this version of Unity?

No, likely has nothing to do with your Unity version. You will need to show us some code so we can figure out what the problem is

Thanks for your reply, bixarrio.

There isn’t any new code that I’m implementing myself in this section of the course.

I’m taking a gameobject I’ve added an animator to and turned into a timeline itself, creating a prefab from that gameobject, then adding the prefab back to the to a control track on the master timeline, then the duplicate to a second control track that can play later. The idea is that with one prefab I should be able to reuse it in different areas of the game world at different times. But it doesn’t work, it just snaps back to where the original gameobject was. I’ve tried everything I can think of, rewatched the video 5 times. I’m absolutely stumped.

I didn’t do this course. Hold on, let me see what Rick is doing and I’ll get back to you.


Edit
You will have to show me how you set the waves up. Rick’s work, so you probably have something different

OK then, you’ll have ro give me a couple of hours as I’m watching my little one

OK, so here’s the differing locations of each spawn location


I’m not familiar with sharing videos so hopefully this link works. despite having two separate control tracks exactly like Rick’s, they still spawn in the same place. The ship and timeline track are stored as a prefab, again exactly like in the lecture. I’ve no idea what’s going on.

https://drive.google.com/file/d/1GiyGIyygZdYEhKXxmhXrUNLcVc7i9QQK/view?usp=sharing

I can’t access the video, and both images are of the same timeline (InstanceB). Probably because the timeline is locked.
It looks like you animated the prefab. This is not correct. The timeline is on the prefab, but each ship inside it is what you should animate. Not the prefab. Look carefully at what Rick does; Once he locks the timeline he drags the ships into it, start recording on the ships, and then moves the ships

Ohhhhh, I see. Once my partner goes to bed I’ll try this approach.

I think I had InstanceB selected on the timeline each time but the point was that each gameobject was in a very different location. Thanks for the information

  • you’re absolutely correct by the way, I did animate the parent, thinking I could change what I wanted to be inside of it without creating extra work. I’ll just remap it all out again although I had hoped to avoid that as I had finessed all the momentum and rotation to be pretty dang perfect. Live and learn!

The animation is from the object’s local position so when you animate the object and then move it, it will move back to where it was originally animated. With the ships inside the prefab it works the same, but they are animated relative to the prefab, so their animated values don’t move them back because they are already back - relative to the prefab. But the prefab can be somewhere else.

hi bixarrio, sorry for the late reply, I had taken a hiatus on this for a couple of weeks. You were correct, if I animate the empty parent itself, the wave is referencing the grandparent for the coordinates (I think). When I animated it the correct way the problem was solved. Many thanks for your time.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms