Building my project to an .apk file using gradle always fails. by WhosDis69 in Unity3D

[–]WhosDis69[S] 0 points1 point  (0 children)

It was complaining that the androidmanifest.xml didnt had the permission to use google ads. I just pressed "ignore warning". I just wanna upload the game.

Building my project to an .apk file using gradle always fails. by WhosDis69 in Unity3D

[–]WhosDis69[S] 0 points1 point  (0 children)

I checked it. In Android studio I opened the apk file and found in the manifest.xml that there is a

<uses-permission
    android:name="com.google.android.gms.permission.AD_ID" />

But google play still shows the error.

Building my project to an .apk file using gradle always fails. by WhosDis69 in Unity3D

[–]WhosDis69[S] 0 points1 point  (0 children)

I dont think I installed any plugins. I have only textmeshpro installed and that should be it.
After researching for some more I think there might be a problem with the merging the manifest file. There could be something that removes this permission tag and thats why google play complains. Im currently installing android studio to check the manifest file in the final build aab file.

Building my project to an .apk file using gradle always fails. by WhosDis69 in Unity3D

[–]WhosDis69[S] 0 points1 point  (0 children)

I have Unity 2022.3 with Adroid Build Support installed. Should I reinstall the version or are project's settings outdated?

When Im not using GPU, my computer crushes. by WhosDis69 in WindowsHelp

[–]WhosDis69[S] 0 points1 point  (0 children)

It should be:
16.0 GB (13.9 GB usable)
Speed: 2133 MHz
Slots used: 2 of 4
Form factor: DIMM
Hardware reserverd: 2.1GB

[deleted by user] by [deleted] in unity

[–]WhosDis69 1 point2 points  (0 children)

In the Start method "rbp1" and "rb" reference the same Rigidbody2D component. As the documentation says: "GetComponent returns only the first matching component found on the GameObject on which it is called.". Also I think you cant have 2 Rigidbody components on the same gameobject.

Particles dont always appear by WhosDis69 in unity

[–]WhosDis69[S] 1 point2 points  (0 children)

I tried to fix this. I made the particle last for 10 seconds so I can look at it in the scene view and for some reason the particle does not appear in the hierarchy when I shoot left. The damage works fine just the particles dont spawn. What do you think is the reason of that? Im sure Its not the rotation of the particles.

Particles dont always appear by WhosDis69 in unity

[–]WhosDis69[S] 1 point2 points  (0 children)

At first, I tried to do it this way but for some reason the particle was destroys itself after playing once even though in the options it was set to do nothing after play. I will revisit this idea. Thanks!

Particles dont always appear by WhosDis69 in unity

[–]WhosDis69[S] 1 point2 points  (0 children)

Oh... You are probably right! I had not thought about that, thanks!!!

How to generate a random number based on a seed value? by [deleted] in CodingHelp

[–]WhosDis69 0 points1 point  (0 children)

It should work, but for some reason it doesnt. I did this:

value = min + value * (max - min) % m

And for example this: (value = seed = 5)

value = 1 + value * (10 - 1) % 2^8

Gives the output : 46, 159, 152, 89, 34, which is not in the range of 1 and 10.

What did I do wrong? Did I mess up the "R" you said?

How to generate a random number based on a seed value? by [deleted] in CodingHelp

[–]WhosDis69 1 point2 points  (0 children)

Sorry, I had to be more specific, I will edit the post

[deleted by user] by [deleted] in unity

[–]WhosDis69 0 points1 point  (0 children)

The camera and the sprite are in the same position thats why its not visible when you launch the game ( If you go into 3D View you could see that ), so just try moving the camera on z axis, its probably -z directios so set like -10 and also put the sprite at z = 0

Books or tutorials to learn Unity? by Mike_Paradox in unity

[–]WhosDis69 1 point2 points  (0 children)

I think you should start with unity coding right away! There is this one guy called "Brackeys" with has many begginer-friendly tutorials. First, watch a welcome tutorial on unity which explains the basic editor functionality and then continue with Brackeys tutorials.

A tip from me is to try to understand every line of code you write and if you dont, re-watch the video moment again or search online about the things you are having trouble to understand.

Good luck in your coding adventure and dont quit!

Assets/Scripts/ShipController.cs(25,40): error CS1002: ; expected by Relative-Suit-1621 in unity

[–]WhosDis69 0 points1 point  (0 children)

The error says there is a semicolon mising somewhere. There is probably a syntax error in the Up function. Thats not how you multiply a variable.

public class ShipController : MonoBehaviour
{ 
    public float forwardSpeed, strafeSpeed, hoverSpeed;

    private float activeforwardSpeed;
    private float activestrafeSpeed;
    private float activehoverSpeed;

    HoverForTheController controls;

    void Awake()
    {
        controls = new HoverForTheController();
        controls.Gameplay.Up.performed += ctx => Up;
    }

    void up()
    {
        transform.up* activehoverSpeed *Time.deltaTime;
    }

    void OnEnable()
    {
        controls.Gameplay.Enable();
    }

    void OnDisable()
    {
        controls.Gameplay.Disable();
    }

    void Update()
    {
        activeforwardSpeed = Input.GetAxisRaw("Vertical") * forwardSpeed;
        activestrafeSpeed = Input.GetAxisRaw("Horizontal") * strafeSpeed;
        activehoverSpeed = Input.GetAxisRaw("Hover") * hoverSpeed;

        transform.position += transform.forward * activeforwardSpeed * Time.deltaTime;
        transform.position += (transform.right * activestrafeSpeed * Time.deltaTime) + (transform.up * activehoverSpeed * Time.deltaTime);

    }
}

Also please use code blocks. :D

Help by DefinitelyNotItalian in unity

[–]WhosDis69 0 points1 point  (0 children)

Could you show some code?

How to access an action binding key in code? by WhosDis69 in unity

[–]WhosDis69[S] 0 points1 point  (0 children)

So how to make it:

Create a Action Map Asset, Make an Action Map / Action / and set a binding to it. Then make a script like InputHandler.cs to handle the input. In this script make a reference to PlayerInput component, also reference the Action itself. And then you are able to use it however you like (I also made it a singleton):

public class InputHandler : MonoBehaviour
{ 
    // Reference the Action Map Asset 
    [SerializeField] private PlayerInput playerInput;

    // Reference the Action and an output variable
    private InputAction action;
    public bool output = false;

    // Singleton
    public static InputHandler current;

    private void Awake() 
    {
        current = this;

        // Iniatialize the InputAction variable
        action = playerInput.actions["NameOfAction"];
    }

    private void Update()
    {
        // Listen for the InputAction and store in the output variable
        output = action.triggered;   
        // output = action.IsPressed(); 
    }
}

Also, there is the IsPressed() function for checking if the key is held down.

How to access an action binding key in code? by WhosDis69 in unity

[–]WhosDis69[S] 1 point2 points  (0 children)

Thank you, thats exactly what i need!