#Dash and X Flip

1 messages Β· Page 1 of 1 (latest)

drifting ibex
#

Have you tested that Dash works at some point?

dire wedge
#

yes it works, i just removed the local.scale part and its the same bahaviour, my stuff works fine unless i somewhere reset currentCooldown.

#

i use print to observe the bahaviour of currentCooldown

#

when i start the game dash is in cooldown, so im even sure the condition is working. i just cant reset it πŸ˜„

drifting ibex
#

Alright. If you're not too deep in anything else in the Editor, you could save your stuff and Restart Unity,
then open it again, and Edit > Preferences > External Tools > Regenerate Project Files
To make sure it's not a bug.

dire wedge
#

ok i will try this πŸ‘

drifting ibex
#

Flipping your player should be done by flipping the X rotation by 180 degrees.
The X axis cannot be edited directly, so one must create a new Vector3 and replace the old one.

#

If there is for example a Healthbar on the Player game object,
you may not want all the game objects in the hierarchy to rotate their X value. (as the Text or Bar also would be flipped)
That's when you choose localRotation or localEulerAngles instead of the one that affects the entire object hierarchy.

#

local only affects that specific game object

#

(Maybe you know this, I'm just being thorough)

#

People usually notice these things when rotation is involved

dire wedge
#

No makes sense, it felt wierd to hardcode the size of my object with ever turn.

drifting ibex
#

is the Dash currently working as intended?

dire wedge
#

sadly not. I replaced all code in dash but the dash itself and currentCooldown = 0;
So no more LocalScale checking. Still the same issue, it runs and reset the timer on tab but no dash > if i remove the timer reset it resets the timer but does not dash. Its like the command before currentCooldown = 0; gets skipped somehow.

drifting ibex
#

without the timer, can you trigger a Dash?

#

does the base function work, or is it flawed?

dire wedge
#

It seems to work perfectly fine without the timer, it even works with the timer (by not letting me dash when i start the game as currentCooldown is 0 > i can dash after 3 seconds).

drifting ibex
#

Link me the updated code

dire wedge
#

it just makes no sense why would the line 55 make line 54 not run πŸ˜•

#

(if i remove 55) everything works fine, i can dash after 3 seconds and timer keeps running.

drifting ibex
#

Can't recall if this is my superstition or if if it's actually an issue, but it's best to be on Every Safe Side when debugging.

dire wedge
#

same behavior with "e"

drifting ibex
#

(got caught up in a conversation)

dire wedge
#

no worries, im trying to change the rotation for now. Kinda feel lost on the dash :/ im not familar with unity but iv done programming and it just seems weird to skip a command just because of the following command

drifting ibex
#

There could very well be a logic issue with the combination of Movement, Jump and Dash.

#

It's been a while since I was into this. Have you checked any of the Dash tutorials?

#

They should cover any unintuitive issues

dire wedge
#

seems very likely, ill give it a try πŸ™‚ thanks for your time and advices!

drifting ibex
drifting ibex
#

In this picture, you can see the formula for ForceMode.Force and .Impulse
plus the 3D-specific ones.

#

Since you are moving by rigidbody.velocity
those may come in handy at some point.

#

Have a nice day o/