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
883
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
883
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
883
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,875
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
883
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
  • K3Nv2 @ K3Nv2:
    I was gone for like an hour and none of you thought to write or call pos
  • BigOnYa @ BigOnYa:
    We knew you were going to Sonic to get lunch.
  • K3Nv2 @ K3Nv2:
    Sonics fast I would've been home in 10 mins
  • BigOnYa @ BigOnYa:
    Meet and greet with AncientBoi then?
  • K3Nv2 @ K3Nv2:
    That would've gone slow he's old
    +1
  • ZeroT21 @ ZeroT21:
    sadly the person in question feels too young for his own good
  • K3Nv2 @ K3Nv2:
    We don't question people
  • ZeroT21 @ ZeroT21:
    me neither, i just bash them
  • K3Nv2 @ K3Nv2:
    We just question @AncientBoi
  • ZeroT21 @ ZeroT21:
    it wasn't a question, it was fact
  • BigOnYa @ BigOnYa:
    He said he had 3 different doctors apt this week, so he prob there. Something about gerbal extraction, I don't know.
    +1
  • ZeroT21 @ ZeroT21:
    bored, guess i'll spread more democracy
  • LeoTCK @ LeoTCK:
    @K3Nv2 one more time you say such bs to @BakerMan and I'll smack you across the whole planet
  • K3Nv2 @ K3Nv2:
    Make sure you smack my booty daddy
    +1
  • LeoTCK @ LeoTCK:
    telling him that my partner is luke...does he look like someone with such big ne
    eds?
  • LeoTCK @ LeoTCK:
    do you really think I could stand living with someone like luke?
  • LeoTCK @ LeoTCK:
    I suppose luke has "special needs" but he's not my partner, did you just say that to piss me off again?
  • LeoTCK @ LeoTCK:
    besides I had bigger worries today
  • LeoTCK @ LeoTCK:
    but what do you know about that, you won't believe me anyways
  • K3Nv2 @ K3Nv2:
    @BigOnYa can answer that
  • BigOnYa @ BigOnYa:
    BigOnYa already left the chat
  • K3Nv2 @ K3Nv2:
    Biginya
  • BigOnYa @ BigOnYa:
    Auto correct got me, I'm on my tablet, i need to turn that shit off
  • K3Nv2 @ K3Nv2:
    With other tabs open you perv
    K3Nv2 @ K3Nv2: With other tabs open you perv