Projectiles tilt upwards

The x value of my axe and corgette increases slightly when speed is not 0. How do I fix this?

Hi Griffin,

Just to confirm some details…

Are these projectiles being instantiated from code, or are these dragged to the scene?

When you say that you have the speed set to zero, is the projectile still animated?

I’ve dragged them to the scene. The projectile is still animated.

Great, so, chances are it’s the animation that is moving the projectile then.

Open the Animation tab and view the Dope Sheet, have a look at the transform properties of the selected projectile in the Hierarchy and see if you can find a key where the value is changing, if you don’t want that to happen, delete the key. You can slide the bar along the timeline in order to watch the GameObject animate so you can find the exact moment the movement in the direction you don’t want occurs.

As with all advice where the word “delete” is mentioned, I feel I should add a little disclaimer with regards to “Take a backup of your project before making any significant changes”… there we go, I’m off the hook :wink:

I don’t see the x position changing in the dopesheet, and I only have keyframes set for rotation. The x value only changes when I’m running the program :weary:

Can you provide a screenshot or better still, a video clip, of the issue?

If not, perhaps you could zip up the project files and share them, I am happy to take a quick look. The forum will support uploads of up to 10mb, Glitch Garden is likely to be larger than that so you’ll need to use a service such as Google Drive or Dropbox and then share the URL.

Thank you so much, here’s a link:

Grabbing it now…

…having some trouble with Google Drive, it’s taking a while to zip… had it the first time but when it warned about it being potentially dangerous I hit “Discard” assuming it meant the warning, not the download… just waiting on Google at the moment :slight_smile:

Out of interest, is this your working directory? Do you have this open at the moment? It doesn't seem to be working.

Could you perhaps zip it at your end and then just share the zip with me, the zipping process via Google Drive doesn’t seem to be responding very well.

It’s ok, I’ve got a copy now… finally!

Updated Mon Sep 03 2018 23:30

Hi Griffin,

So, it seems ok to me, once the projectile speed is set to zero, there is only rotation of the zucchini;

it will be clearer to see the details if you maximise the above video

Also, be aware that your GameObject for the Axe, and it’s child Body GameObject are not in the same location. If you select the parent GameObject in scene view you’ll see it off to the left, whilst the body is on the grass background.

Hey Rob, if you set the speed to 1 you’ll see the zucchini and axe drift upwards. Thanks again for helping me out with this

Ah, I see, I thought you said they moved on the X if speed was set to zero, ok, I’ll take a look again.

Updated Mon Sep 03 2018 23:54

If you look at your prefab (and the instances) of the zucchini, you have rotation applied on the Z axis, set that to zero, on the prefab. Update the instances, or drag another one into the scene, problem goes away.

That did it. You guys are the best thanks again

1 Like

Great and no problem.

Incidentally, if you want the zucchini to rotate clockwise, which may look more realistic if its being thrown from the left of the screen, change the value of 365 to -365 on the last key of your animation, it’ll rotate the other way then :slight_smile:

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

Privacy & Terms