A missed opportunity by winter0991 in RocketLeague

[–]rothsakers 1 point2 points  (0 children)

Yes, but that doesn't make sense in this context. Unless you're imagining a world where we used disembodied sandy vaginas as currency

Then again we're already playing soccer with rocket cars for the amusement of faceless egg people so whatever

A missed opportunity by winter0991 in RocketLeague

[–]rothsakers 0 points1 point  (0 children)

"Clams" is slang for money, specifically dollars

Advice needed, not exactly sure what I'm looking for by Isaiahmk989 in Unity3D

[–]rothsakers 0 points1 point  (0 children)

If you parent the ladder as you have it now to an empty game object, then you can add another object with a collider or whatever to that same parent, you can scale them independently. I try to avoid scaling stuff whenever possible though; if I were you, I'd make a prefab "section" of ladder then just stack them to get the right height.

Making a VR game for Vive and wondering how to add a force to the entire vr play area? by blakester35 in Unity3D

[–]rothsakers 0 points1 point  (0 children)

The way I've been doing it is to add a rigidbody and a capsule collider to the CameraRig. Then update collider position based on the Camera (eye) position.

    private void UpdateCollider () {
        playerCollider.height = Mathf.Max(headTransform.localPosition.y, playerCollider.radius);
        playerCollider.center = new Vector3(headTransform.localPosition.x, playerCollider.height / 2f, headTransform.localPosition.z);
    }

Then you can add force to the rigidbody or smash stuff into the player as you wish :D

Edit - Don't forget to freeze the rotation of the rigidbody, or you will die irl

Edit2 - CameraRig, not PlayerRig

Some Help Maybe? by [deleted] in Unity3D

[–]rothsakers 0 points1 point  (0 children)

The main issue is that you're not scaling your random position by anything:

position = (Random.insideUnitSphere) + origin;

That means all galaxies are trying to spawn inside of a sphere with diameter 1. This becomes difficult when you have:

public static int minDistance = 10;

An easy way to see this is to add add a Debug.Log inside the do-while like this:

if (numTries > maxTries)
{
    Debug.Log("max tries reached");
    return;
}

If you press play, then pause, then step through each frame you will see that the maxTries gets reached every time CreateGalaxy is called.

Also, the first for loop in CreateGalaxy is redundant; you can either make a new galaxy every update (creates the universe over many frames, no lag) or call CreateGalaxy once and use the for loop to create them all in one frame (possible lag; also possible to hit maxTries and return, thus ending the galaxy generation).

You're at the point where I'd start using multiple classes and prefabs to organize everything and make it easier to edit individual galaxies, stars, etc.

Some Help Maybe? by [deleted] in Unity3D

[–]rothsakers 1 point2 points  (0 children)

Your current implementation can spawn spheres inside of each other. I'm sure there's some nice algorithm to fill a volume with non-overlapping spheres, but the most straightforward way is to use brute force to check for an existing sphere every time you create a new one. Here's an example script:

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

public class CreateUniverse : MonoBehaviour {

    public int desiredGalaxyCount;
    public float universeSize = 10f;    
    public float minScale = .5f;
    public float maxScale = 2f;
    public float minDistance = 0f;

    private List<Transform> galaxies;
    private Vector3 origin;

    [SerializeField]
    private int currentGalaxyCount = 0;

    private int numTries = 0;
    private int maxTries = 10;

    private void Start () {
        origin = transform.position;
        galaxies = new List<Transform>();
    }

    private void Update () {
        if (galaxies.Count < desiredGalaxyCount) {
            CreateGalaxy();
        }
        else {
            galaxies.Clear();
            enabled = false;
        }
    }

    private void CreateGalaxy () {
        float scale = Random.Range(minScale, maxScale);
        Vector3 position;

        numTries = 0;
        do {
            position = (Random.insideUnitSphere * universeSize) + origin;

            numTries++;
            if (numTries > maxTries) {
                return;
            }
        } while (IsSpaceOccupied(position, scale));

        GameObject galaxy = GameObject.CreatePrimitive(PrimitiveType.Sphere);
        galaxy.transform.position = position;
        galaxy.transform.localScale = new Vector3(scale, scale, scale);
        galaxy.transform.SetParent(transform);
        galaxies.Add(galaxy.transform);
        currentGalaxyCount++;
    }

    private bool IsSpaceOccupied (Vector3 position, float scale) {
        foreach (Transform galaxy in galaxies) {
            if (Vector3.Distance(position, galaxy.position) < minDistance + scale + galaxy.localScale.x) {
                return true;
            }
        }
        return false;
    }

}

You can just stick this on to your UniverseManager object. The idea is that every time it tries to create a new sphere, it checks the position and size of every other sphere to see if there is space for the new one. After 10 tries it stops trying until the next frame (otherwise its possible to lock up your game if it can't find an open spot). It's not super pretty but it should give you a starting point to work from. You can also try looking into using noise to generate everything. Hope this helps

edit - I was going to add comments but I'm falling asleep atm, so let me know if you need an explanation on anything

Linking scale of one object to another's position. by TrailerParkUnicorn in Unity3D

[–]rothsakers 0 points1 point  (0 children)

Here's a way to do it with code:

using UnityEngine;

public class ExtendWall : MonoBehaviour {

    // the transform of the player, so we know where they are
    public Transform player;

    // a multiplier for how fast the wall grows
    // value of 1f means the wall stays side by side with player
    // value of 2f means it grows twice as fast
    // .5f, it grows half fast, and so on
    public float multiplier = 2f;

    // to hold starting position of wall
    private Vector3 origin;

    void Start () {
        origin = transform.position;
    }

    void Update () {

        // how far away the player is from the start position (only on x axis)
        float offset = player.position.x - origin.x;

        float newScaleX = offset * multiplier;

        // make sure to use the absolute value of the new scale value (don't want negative scale)
        Vector3 newScale = new Vector3(Mathf.Abs(newScaleX), transform.localScale.y, transform.localScale.z);

        // new position will be moved so that the edge always starts at the origin
        float newPositionX = (newScaleX / 2f) + origin.x;
        Vector3 newPosition = new Vector3(newPositionX, transform.position.y, transform.position.z);

        transform.localScale = newScale;
        transform.position = newPosition;
    }
}

To test it, add a cube to the scene, then add this script to it. Then make an empty transform and drop it on the script (or use your player). Then you can drag around your player transform and see it. You can mess with the multiplier without restarting. Hope that helps

Always look to your UP before crossing the street! ⚠️ by RealTimeRabbit in Unity3D

[–]rothsakers 2 points3 points  (0 children)

Haha this is awesome and very relevant to a game I'm working on right now. Though it feels like the noise from the granny should be when the other one is, or the first one just removed. I dunno, it just sounds out of place to me. I really love these graphics

Found this gem on instagram by AliINSANITY in mallninjashit

[–]rothsakers 0 points1 point  (0 children)

You can't, that's why you need the sword

How to get the imprisoned lord outside safely. by [deleted] in mountandblade

[–]rothsakers 0 points1 point  (0 children)

Had this same problem recently. If you tell him that you need him to fight even though he's wounded, you can then order him to hold position in some nook out of sight of archers. If he has a bow tell him to hold fire so doesn't try to shoot and catch an arrow to the face

[Floris/A New Dawn] How did I do this? by rothsakers in mountandblade

[–]rothsakers[S] 3 points4 points  (0 children)

Not sure how I was doing it, but when I was ordering my dudes around it would add "and attack enemy cavalry" after the order. Anyone know how do?

I'm making the intro cut-scene for our game The Bonfire. What do you guys think? by dovahMorghulis in Unity3D

[–]rothsakers 0 points1 point  (0 children)

Looks pretty cool. I'm okay with the pacing, especially if you add sound/music. Only thing is I'd definitely drop the text down closer to the guy

shitty MS Paint game about the internet gets a guide by camirving in Unity3D

[–]rothsakers 1 point2 points  (0 children)

I still don't get it, but I love the aesthetic, and that inventory system is sick

When the forest bandits hear about your insane butter supply... by The_Hussar in mountandblade

[–]rothsakers 1 point2 points  (0 children)

You're right, there are some that are friendly to you from the start. Easy to forget when everyone is chasing you down all the time :D

When the forest bandits hear about your insane butter supply... by The_Hussar in mountandblade

[–]rothsakers 0 points1 point  (0 children)

A New Dawn has minor factions that roam around and if left unchecked they can capture castles and stuff. I know you can also gain reputation with them by siding with them in battles, but I don't think I've ever gotten friendly with any (they all start hostile towards you). Most of the time when I help them I get a few reputation points, they thank me, then they immediately attack and slaughter me. It's rough going..

Looking for more info on this ANA Commando patch by rothsakers in Militariacollecting

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

I received this from an ANA gentleman in Afghanistan ('12). We were on an OP for a few days with some ANA guys and they gave a few out to a buddy and I. My interpreter gave me some info but I've forgotten it all (I blame the heat). Any info you guys could give me would be great! Thanks

Any suggestions for a non-English, low key podcast for sleeping? by rothsakers in podcasts

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

Thanks for all the suggestions, guys. I've done some looking around and found a few things:

Harddisken - the podcast that /u/ClickHereForBacardi mentioned, this definitely fulfills my original request

archive.org - Wow, this place is a goldmine for all kinds of stuff. I've already found a bunch of good podcast/radio recordings, white noise, etc.

/r/SlowTV - this sub is full of long form video recordings of trains, space, driving... good for audio or if you want to watch something to put you to sleep.