Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

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?

First off, you need to make sure that there is a statement in the Update void, that says something like "if (Vector3.distance(base.transform.position, this.dragdestination) < 5) { this.dragging = false }. Have you done something like that yet?

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.

Does your character have a rigidbody, and a collider? If so, then you may want to re-check the name of the room trigger.

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?

inside of the OnTriggerEnter script, make sure to add something like "this.dragcooldown <= 0" inside of the if statement.

(+1)

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