KASWECE 로고

삶과 사회는 아이들이 이끌어갑니다.

자유게시판

Unable to make use of Space Bar in Character Controller with GetKey to…

페이지 정보

profile_image
작성자 Regena
댓글 0건 조회 65회 작성일 23-11-01 22:44

본문


I'm new to coding and Unity3d on space bar slot the whole. So attempting to be taught and determine how things work and what's what I decided to make use of some code from a web-based tutorial made by Jason Weimann on his YT channel to get me began with player movement. I downloaded the whole venture, opened it in Unity (upgraded the undertaking from Unity 2019.3.4f1 to Unity 2020.1.1f1). Fired up the scene (with few simple setting elements and a player with character controller). Everything works as it presupposed to till I press space to make the participant jump. So I dived into the code, modified Input.GetKey(KeyCode.Space) to Input.GetKey(KeyCode.E) and it works... I tried with various different keys and all of them work apart from the space bar. I also tried Input.GetKeyDown works advantageous too, however not when the key is specified as Space. Any thought why this might be happening?? Please see the code beneath, though I do not assume there's something wrong with it (since another key works just fine and i wasn't the one to write it LOL)

EDIT Thanks for all the options to date. The author of the code was able to get this code to work with Input.GetKey although Unity documentation does not mention this key code to work with it (only with Input.GetKeyDown and Input.GetKeyUp). Script works with every other key code. I tried using this code in a completely new mission and obtained the identical results as earlier than - cannot use area to jump, every other key works. Could or not it's one thing in my Unity3D settings?


To find more info in regards to space bar slot visit our own web page.

댓글목록

등록된 댓글이 없습니다.