CODING, RESOURCES & SOUND FX
Bits of useful code and stuff
To make a score variable in your Twine story, use this code:
(set: $score to 50)
To show the score anywhere in your text, write $score. So for example:
Your current score is: $score.
To add to the score, or take away from it, use the following:
(set: $score to $score+25)
(set: $score to $score-25)
Swap 25 for however much you want to increase or decrease the score.
More Twine resources are coming soon.
Script for making a sphere rotate automatically (should be attached to the sphere itself in a C# script).
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class rotate_the_earth : MonoBehaviour
{
public float speed = -10f;
void Update()
{
transform.Rotate(0,speed * Time.deltaTime,0);
}
}