Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Adroopyboi

13
Posts
A member registered Mar 04, 2021 · View creator page →

Creator of

Recent community posts

I have all the sprites done for the character, just gotta make color minigame assets and audio. Do you have a discord server or account where I could message you and send you the sprites so far?

Ok so I looked up the Baldi's Basics Map Pack and realized that I might have seen this Big Help character before. Big Help basically does the exact thing that I coded this guy to do, so I thought of a similar, but somewhat different mechanic if you want to hear it and maybe reconsider adding this Thought Constructor guy.

Ok, here's another character I'm working on, but this one's currently a work in progress, and has very little code.

Name: Silly Little Artist

She wanders around the school, and will take the player to her art classroom. Once there the door is locked and she stands in front of a painting canvas, while asking the player to hand her certain colored paint buckets on the floor. Once done you are free to leave. However, if you go in her room when she is not there, you can choose to spill black paint on the canvas, ruining it. If the canvas is ruined when she tries to start the minigame, you will be let out early and she will take time to clean the canvas. But she checks her room often and if she catches you messing with the canvas to skip art class, she'll drag you to random spots in the school at high speed while yelling.

I don't have a lot of graphics for this character yet, just this drawing that shows the design and basic idea of the minigame: I plan to make an anim8or model of the character soon, and can send it over to you if this concept is accepted.

Seeing as you were able to help me create this character, I find it fair if you use it in your game

Name: Thought Constructor

He wanders around similarly to Playtime. When he sees the player, he'll rush towards them and if they interact he'll grab the player and drag them to his Safezone Room. The player can wear Big Ol' Boots to avoid this.

Graphics: ConstructorConstructor Office Poster

If you want I can send you the code for him.

I got it to work! Thank you for the help, this worked.

Yes he has both and the room name is right. I think the issue is that he is always willing to interact with the player even when he is supposed to be in cooldown. How would I disable his collider when he is meant to be in cooldown?

I have an OnTriggerEnter void that's supposed to put him into a cooldown mode and make him let go of the player once he collides with the trigger in the center of the room, but I must've done something wrong because even when he is in the collider he doesn't let go or activate his cooldown.

Hello! I'm the guy who asked you for help with the grabby guy a few days ago. I recently restarted and rewrote pretty much of the code to look more like Playtime's, but instead of activating a jump rope you get dragged. Now that the script is cleaned up and more legible, do you think you could help me understand why he doesn't let go of the player?

Ok, thank you for the help regardless

Ok well how would you suggest I write it? I'm really bad with colliders. I just tried to rewrite the code but now all he does is run to the base's transform without touching the player and he can't grab the player anymore.

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using UnityEngine.AI;

public class YallEeverScript : MonoBehaviour

{

// Token: 0x0600030A RID: 778 RVA: 0x00016852 File Offset: 0x00014A52

private void Start()

    {

        this.agent = base.GetComponent<NavMeshAgent>();

        this.audioDevice = base.GetComponent<AudioSource>();

        this.Wander();

    }

    // Token: 0x0600030B RID: 779 RVA: 0x00016874 File Offset: 0x00014A74

    private void Update()

    {

        if (this.coolDown > 0f)

        {

            this.coolDown -= 1f * Time.deltaTime;

        }

        if (this.warpCool >= 0f)

        {

            this.warpCool -= Time.deltaTime;

        }

        if (this.isDragging & this.playerTouched)

        {

            this.player.position = new Vector3(base.transform.position.x - 1f, 4f, base.transform.position.z);

            this.agent.speed = 60f;

        }

    }

    // Token: 0x0600030C RID: 780 RVA: 0x00016920 File Offset: 0x00014B20

    private void FixedUpdate()

    {

        if (!this.ps.toBase)

        {

            Vector3 direction = this.player.position - base.transform.position;

            RaycastHit raycastHit;

            if (Physics.Raycast(base.transform.position, direction, out raycastHit, float.PositiveInfinity, 3, QueryTriggerInteraction.Ignore) & raycastHit.transform.tag == "Player" & (base.transform.position - this.player.position).magnitude <= 80f & this.warpCool <= 0f)

            {

                this.playerSeen = true;

                this.TargetPlayer();

            }

            else if (this.playerSeen & this.coolDown <= 0f)

            {

                this.playerSeen = false;

                this.Wander();

            }

            else if (this.agent.velocity.magnitude <= 1f & this.coolDown <= 0f)

            {

                this.Wander();

            }

            this.playerTouched = false;

        }

        if (this.warpCool <= 0f)

        {

            this.ps.toBase = false;

        }

    }

    // Token: 0x0600030D RID: 781 RVA: 0x00016A58 File Offset: 0x00014C58

    private void OnTriggerStay(Collider other)

    {

        if (other.tag == "Player" & !this.ps.toBase)

        {

            this.isDragging = true;

            this.playerTouched = true;

            this.agent.SetDestination(this.basePosition.position);

        }

    }

    // Token: 0x0600030E RID: 782 RVA: 0x00016AAC File Offset: 0x00014CAC

    private void OnTriggerExit(Collider other)

    {

        if (other.tag == "Player" & this.ps.toBase)

        {

            this.isDragging = false;

            this.playerTouched = false;

            this.Wander();

        }

        this.agent.speed = 15f;

    }

    // Token: 0x0600030F RID: 783 RVA: 0x00016AFC File Offset: 0x00014CFC

    private void Wander()

    {

        this.wanderer.GetNewTargetHallway();

        this.agent.SetDestination(this.wanderTarget.position);

        this.agent.speed = 15f;

        this.playerSpotted = false;

        this.coolDown = 1f;

    }

    // Token: 0x06000310 RID: 784 RVA: 0x00016B9E File Offset: 0x00014D9E

    public IEnumerator CollisionCooldown()

    {

        this.ps.toBase = true;

        yield return new WaitForSeconds(this.warpCool);

        this.ps.toBase = false;

        yield break;

    }

    // Token: 0x06000311 RID: 785 RVA: 0x00016BB0 File Offset: 0x00014DB0

    private void TargetPlayer()

    {

        this.agent.SetDestination(this.player.position);

        this.agent.speed = 25f;

        this.coolDown = 0.2f;

    }

    // Token: 0x06000307 RID: 775 RVA: 0x000167A0 File Offset: 0x000149A0

    private void OnTriggerEnter(Collider other)

    {

        if (other.tag == "Player")

        {

            this.eever.audVal = Mathf.RoundToInt(Random.Range(0f, 1f));

            base.StartCoroutine(this.GrabCool());

        }

        if (grabCollider = baseCollider)

            {

            this.isDragging = false;

            this.playerSpotted = false;

            this.playerTouched = false;

            this.warpCool = 15f;

            }

    }

    // Token: 0x06000308 RID: 776 RVA: 0x0001683B File Offset: 0x00014A3B

    private IEnumerator GrabCool()

    {

        this.Hit.enabled = false;

        yield return new WaitForSeconds(15f);

        this.Hit.enabled = true;

        yield break;

    }

    // Token: 0x0400039F RID: 927

    public Collider Hit;

    // Token: 0x040003A0 RID: 928

    public YallEeverScript eever;

    // Token: 0x040003A1 RID: 929

    public Collider grabCollider;

    // Token: 0x040003A2 RID: 930

    public bool playerTouched;

    // Token: 0x040003A3 RID: 931

    public bool db;

    // Token: 0x040003A4 RID: 932

    public bool playerSeen;

    // Token: 0x040003A5 RID: 933

    public bool enemySeen;

    // Token: 0x040003A6 RID: 934

    public int audVal;

    // Token: 0x040003A7 RID: 935

    public Transform player;

    // Token: 0x040003A8 RID: 936

    public PlayerScript ps;

    // Token: 0x040003A9 RID: 937

    public Transform wanderTarget;

    // Token: 0x040003AA RID: 938

    public AILocationSelectorScript wanderer;

    // Token: 0x040003AB RID: 939

    public float coolDown;

    // Token: 0x040003AC RID: 940

    public float warpCool;

    // Token: 0x040003AD RID: 941

    public bool playerSpotted;

    // Token: 0x040003AE RID: 942

    private NavMeshAgent agent;

    // Token: 0x040003B6 RID: 950

    public AudioSource audioDevice;

    // Token: 0x040003B7 RID: 951

    public Collider baseCollider;

    // Token: 0x040003B8 RID: 952

    public bool isDragging;

    public Transform basePosition;

}

Ok so I tried to make some changes to the code and now he won't interact with the player at all. Would it help if I shared the script I'm using so you could point out where I've gone wrong

So based on these other comments, do you just create working scripts for people? If so could I have a little help with a character of mine not working?

So the way the character works is that if he sees the player, he'll chase after them and then forcefully drag them to a room, similarly to how Mrs. Pomp works when angry. After getting to the room, the character lets you go and should be on a cooldown for about 15 seconds.

My main problem is that the character refuses to let go of the player, even when reaching the specified transform collider, and also does not seem to acknowledge or chase the player. Any help would be appreciated.