Homebrew Yay! Another Stupid Unity Thread!

Mr.ButtButt

The Cancer Of Gbatemp <3
OP
Member
Joined
Sep 22, 2015
Messages
1,465
Trophies
0
XP
893
Country
United States
I've got a 1st person 3DS game up and running, but I can only move with the d-pad, and I can't look around.. I want to know how to only move with the circle pad, and look around with the c-stick. I've been using the default Unity First Person Controller. I'm wondering if I can edit the scripts, or I have to create an entirely new one..
I know Unity uses C#, but I do have basic C++ programming knowledge.

Anyone out there that can help?

(psst @Voxel )
 
  • Like
Reactions: Soulsilve2010
D

Deleted User

Guest
Use GamePad.CirclePad.x and GamePad.CirclePad.y to get the 3DS's respective Circle Pad axis coordinates. Use GamePad.CirclePadPro for the C-Stick/Circle Pad Pro.

For example, if I wanted to move the player forwards or backwards, I would write:
Code:
float MoveSpeed = 5f; //You can just set this at your desire...

transform.Translate(Vector3.forward * (GamePad.CirclePad.y*MoveSpeed) * Time.deltaTime); //this will move the player along its local Z axis, its speed based on the MoveSpeed variable.
 
Last edited by ,

Mr.ButtButt

The Cancer Of Gbatemp <3
OP
Member
Joined
Sep 22, 2015
Messages
1,465
Trophies
0
XP
893
Country
United States
Use GamePad.CirclePad.x and GamePad.CirclePad.y to get the 3DS's respective Circle Pad axis coordinates. Use GamePad.CirclePadPro for the C-Stick/Circle Pad Pro.

For example, if I wanted to move the player forwards or backwards, I would write:
Code:
float MoveSpeed = 5f; //You can just set this at your desire...

transform.Translate(Vector3.forward * (GamePad.CirclePad.y*MoveSpeed) * Time.deltaTime); //this will move the player along its local Z axis, its speed based on the MoveSpeed variable.
Thank you.
What the hell would we do without you?
I would be able to just do it myself, if the Unity Manual was actually like: "Okay here's how unity works!"
Instead of: "Okay, here's a thing. It works sometimes, maybe. Good luck."
 

Mr.ButtButt

The Cancer Of Gbatemp <3
OP
Member
Joined
Sep 22, 2015
Messages
1,465
Trophies
0
XP
893
Country
United States
Use GamePad.CirclePad.x and GamePad.CirclePad.y to get the 3DS's respective Circle Pad axis coordinates. Use GamePad.CirclePadPro for the C-Stick/Circle Pad Pro.

For example, if I wanted to move the player forwards or backwards, I would write:
Code:
float MoveSpeed = 5f; //You can just set this at your desire...

transform.Translate(Vector3.forward * (GamePad.CirclePad.y*MoveSpeed) * Time.deltaTime); //this will move the player along its local Z axis, its speed based on the MoveSpeed variable.
aLRIGHTY, here's part of the script:
Code:
 private void GetInput(out float speed)
        {
            // Read input
            float MoveSpeed = 5f; //You can just set this at your desire...

            transform.Translate(Vector3.forward * (???????.?????.y * MoveSpeed) * Time.deltaTime); //this will move the player along its local Z axis, its speed based on the MoveSpeed variable.

            bool waswalking = m_IsWalking;

#if !MOBILE_INPUT
            // On standalone builds, walk/run speed is modified by a key press.
            // keep track of whether or not the character is walking or running
            m_IsWalking = !Input.GetKey(KeyCode.LeftShift);
#endif
            // set the desired speed to be walking or running
            speed = m_IsWalking ? m_WalkSpeed : m_RunSpeed;
            m_Input = new Vector3(-1, +1);

            // normalize input if it exceeds 1 in combined length:
            if (m_Input.sqrMagnitude > 1)
            {
                m_Input.Normalize();
            }

            // handle speed change to give an fov kick
            // only if the player is going to a run, is running and the fovkick is to be used
            if (m_IsWalking != waswalking && m_UseFovKick && m_CharacterController.velocity.sqrMagnitude > 0)
            {
                StopAllCoroutines();
                StartCoroutine(!m_IsWalking ? m_FovKick.FOVKickUp() : m_FovKick.FOVKickDown());
            }
        }
I can still walk around with the d-pad, but not the circlepad..

--------------------- MERGED ---------------------------

How you build project in unity for 3ds?
You need to register as nintendo dev?
yes
 
Last edited by Mr.ButtButt,

BurningDesire

Well-Known Member
Member
Joined
Jan 27, 2015
Messages
4,999
Trophies
1
Location
Behind a screen reading news
XP
4,885
Country
United States
I wouldn't have gotten in trouble. barely anyone saw this thread, let alone, would know what to do with the code before I edited the post. And if they did sue, I'd call 'em fat head, and they'd never bother me again ;)
Ha! Gottem. Anyways sorry for derailing the thread :P
 
  • Like
Reactions: Mr.ButtButt
D

Deleted User

Guest
I can still walk around with the d-pad, but not the circlepad..
Why do you have a bunch of question marks in your script where GamePad.CirclePad should be?

Also, don't forget to include the following line to the top of your script if you haven't already done so:
Code:
using UnityEngine.N3DS;
 
  • Like
Reactions: Mr.ButtButt

FrostyDialga

Banned!
Banned
Joined
Dec 28, 2016
Messages
193
Trophies
0
XP
136
Country
I wouldn't have gotten in trouble. barely anyone saw this thread, let alone, would know what to do with the code before I edited the post. And if they did sue, I'd call 'em fat head, and they'd never bother me again ;)
Free shop got DMCA ed and the guy just put and on another site and did not give a damn nothing will happen as long as you don't put it on Github.
 

haazet

Well-Known Member
Newcomer
Joined
Dec 15, 2015
Messages
64
Trophies
0
XP
159
Country
United States
Anyone have an example of using the gyroscopic sensor for example rotate a object(camera)? I notice that in regular standard assets there's tilt script in the cross platform but haven't tried it out yet or sure if it the samething
 
Last edited by haazet,

Mr.ButtButt

The Cancer Of Gbatemp <3
OP
Member
Joined
Sep 22, 2015
Messages
1,465
Trophies
0
XP
893
Country
United States
Why do you have a bunch of question marks in your script where GamePad.CirclePad should be?

Also, don't forget to include the following line to the top of your script if you haven't already done so:
Code:
using UnityEngine.N3DS;
I thought it was from the 3ds source in Unity or whatever. btw, i figured out how to use the buttons today, and got a game working!. If you get gyroscope working, ever, get in touch with me, I really need it for a project :)
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BigOnYa @ BigOnYa:
    Biomutant looks cool tho, may have to try that
  • Quincy @ Quincy:
    Usually when such a big title leaks the Temp will be the first to report about it (going off of historical reports here, Pokemon SV being the latest one I can recall seeing pop up here)
  • K3Nv2 @ K3Nv2:
    I still like how a freaking mp3 file hacks webos all that security defeated by text yet again
  • BigOnYa @ BigOnYa:
    They have simulators for everything nowdays, cray cray. How about a sim that shows you playing the Switch.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
    K3Nv2 @ K3Nv2: @BigOnYa...