Yay! Another Stupid Unity Thread!

Discussion in '3DS - Homebrew Development and Emulators' started by Mr.ButtButt, Jan 17, 2017.

  1. Mr.ButtButt
    OP

    Mr.ButtButt The Cancer Of Gbatemp <3

    Member
    1,461
    598
    Sep 22, 2015
    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 )
     
    Soulsilve2010 likes this.
  2. Voxel

    Voxel Clumsy Coder

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,160
    5,806
    Jun 27, 2015
    United Kingdom
    England, UK
    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 Voxel, Jan 17, 2017
    Roomsaver, I pwned U! and Mr.ButtButt like this.
  3. Mr.ButtButt
    OP

    Mr.ButtButt The Cancer Of Gbatemp <3

    Member
    1,461
    598
    Sep 22, 2015
    United States
    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."
     
    Quantumcat, Ricken and Voxel like this.
  4. Jaggred

    Jaggred Member

    Newcomer
    31
    8
    Jan 5, 2017
    United States
    How you build project in unity for 3ds?
    You need to register as nintendo dev?
     
    Mr.ButtButt likes this.
  5. Mr.ButtButt
    OP

    Mr.ButtButt The Cancer Of Gbatemp <3

    Member
    1,461
    598
    Sep 22, 2015
    United States
    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..

    — Posts automatically merged - Please don't double post! —

    yes
     
    Last edited by Mr.ButtButt, Jan 18, 2017
  6. BurningDesire

    BurningDesire GBAtemp Psycho!

    Member
    4,945
    5,728
    Jan 27, 2015
    United States
    Behind a screen reading news
    Isn't this like... against the NDA to share online...
     
  7. Mr.ButtButt
    OP

    Mr.ButtButt The Cancer Of Gbatemp <3

    Member
    1,461
    598
    Sep 22, 2015
    United States
    -snip-
     
  8. iAqua

    iAqua Shadow of Dark.

    Member
    GBAtemp Patron
    iAqua is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    2,631
    2,051
    Dec 7, 2015
    Canada
    Why would unity code be against the NDA?
     
  9. Mr.ButtButt
    OP

    Mr.ButtButt The Cancer Of Gbatemp <3

    Member
    1,461
    598
    Sep 22, 2015
    United States
    he thought it was 3DS specific Unity code that's part of the 3DS sdk that's specifically used with Unity.
    Even if it was, it'd seem like a stretch..
     
    BurningDesire likes this.
  10. iAqua

    iAqua Shadow of Dark.

    Member
    GBAtemp Patron
    iAqua is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    2,631
    2,051
    Dec 7, 2015
    Canada
    she* and uh, yeah, that's a bit of a stretch.
     
    Mr.ButtButt likes this.
  11. Mr.ButtButt
    OP

    Mr.ButtButt The Cancer Of Gbatemp <3

    Member
    1,461
    598
    Sep 22, 2015
    United States
    Sorry, I got her username mixed up with another user from a while back.
    My B, fam.
     
  12. BurningDesire

    BurningDesire GBAtemp Psycho!

    Member
    4,945
    5,728
    Jan 27, 2015
    United States
    Behind a screen reading news
    Idk fam just didn't want him to get in trouble :)
     
    Mr.ButtButt likes this.
  13. Mr.ButtButt
    OP

    Mr.ButtButt The Cancer Of Gbatemp <3

    Member
    1,461
    598
    Sep 22, 2015
    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 ;)
     
  14. BurningDesire

    BurningDesire GBAtemp Psycho!

    Member
    4,945
    5,728
    Jan 27, 2015
    United States
    Behind a screen reading news
    Ha! Gottem. Anyways sorry for derailing the thread :P
     
    Mr.ButtButt likes this.
  15. Mr.ButtButt
    OP

    Mr.ButtButt The Cancer Of Gbatemp <3

    Member
    1,461
    598
    Sep 22, 2015
    United States
    no worries, no one's here anyways. And I still haven't gotten the problem solved LOL
     
    BurningDesire likes this.
  16. Voxel

    Voxel Clumsy Coder

    Member
    GBAtemp Patron
    Voxel is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    5,160
    5,806
    Jun 27, 2015
    United Kingdom
    England, UK
    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;
     
    Mr.ButtButt likes this.
  17. FrostyDialga

    FrostyDialga Banned

    Banned
    193
    45
    Dec 28, 2016
    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.
     
  18. haazet

    haazet Advanced Member

    Newcomer
    62
    23
    Dec 15, 2015
    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, Jan 18, 2017
  19. VinLark

    VinLark This machine kills bourgeois sentimentality.

    Member
    4,068
    4,705
    Jun 11, 2016
    Trinidad and Tobago
    4chan and other wonders of the internet
    No, other people put it an a different site. From what I heard
     
  20. Mr.ButtButt
    OP

    Mr.ButtButt The Cancer Of Gbatemp <3

    Member
    1,461
    598
    Sep 22, 2015
    United States
    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 :)
     
    VinLark and I pwned U! like this.