It wont print

Hi,

Please note, it’s better to copy/paste your code and apply the code fencing characters, rather than using screenshots. Screenshots are ideal for displaying specific details from within a game engine editor or even error messages, but for code, they tend to be less readable, especially on mobile devices which can require extensive zooming and scrolling.

You also prevent those that may offer to help you the ability to copy/paste part of your code back to you with suggestions and/or corrections, meaning that they would need to type a potentially lengthy response. You will often find that people are more likely to respond to your questions if you make it as easy as possible for them to do so.

Is your rocket script assigned to a Rocket game object? Are the messages in your console enabled?

Hope this helps :slight_smile:


See also;

here
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class rocket : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{

}

// Update is called once per frame
void Update()
{
    ProcessInput();
}

private void ProcessInput()
{
    if (Input.GetKey(KeyCode.Space)) // can thrust while rotating
    {
        print("Thrusting");
    }
}

}

Is your rocket script assigned to a Rocket game object? Are the messages in your console enabled?

How are you getting on with this, @mister_oval?

This topic was automatically closed after 23 hours. New replies are no longer allowed.

Privacy & Terms