🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

I need help please

Started by
0 comments, last by Flobby 3 years, 7 months ago

Hello Folk's,

so i've following started to follow a tutorial course for beginner's on

procedual level generation, https://www.udemy.com/course/unity-2d-random-dungeon-generator-for-a-roguelike-video-game/​ it's this course.

In the beginning empty got created holding a sprite in it, the empty was than given

a script, idk the purpose on that script yet since i got my issue so early on.

But the goal in that video was to get the input left or right.

He came up with this at first

void Update()

{ float horz = Input.GetAxis("Horizontal);

Debug.Log("Horizontal: " + horz)

Compiling and testing this this was giving me a float number rising to 1, -1 or 0 depending on

what button i would press, but the number was a float and he wanted integers

so he changed the script to

void Update()

{flaot horz = Input. GetAxisRaw("Horizontal)

Debug.Log("Horizontal: " + horz}

on his project that changed it so that only the numbers -1, 0 , 1 where displayed by the

Debug String, in my Project when i pressed a button i could change from -1 to 1 or

opposite direction 2 times than it wouldnt change anymore. Beside the beginning

the 0 didnt appear again.

I don't know what i've done wrong and am quite helpless, i did everything as he did and even restartet

the project, doing everything a second time. So it may has something to do with my

Unity settings? He was using a Unity version from 2018, and he used monodevelop

i use a 2019.4.14f1 and visual studio code.

This topic is closed to new replies.

Advertisement