Category: Uncategorised

  • PigSquid

    I’ve recently been diving back into Unity to refresh my skills and have a bit of fun. My two kids inspired me to create a game featuring a character they’ve dreamed up—a charming (and slightly absurd) creature called the PigSquid.

    PigSquid is shaping up to be a stealth-based puzzle game where our lovable protagonist must navigate through various quirky challenges, outsmarting obstacles along the way. Inspired by my children’s boundless imagination, PigSquid’s adventures promise to be both humorous and engaging.

    It’s been a great way to reconnect with Unity, experiment creatively, and most importantly, collaborate with my kids to bring their imaginative ideas to life.

    Here’s a little peek at our PigSquid in action. Still lots to do, but we’re having a great time making it!

  • Tentacle Mechanincs

    In my latest Unity project Pig Squid, I implemented dynamic tentacle mechanics to enhance player movement and interaction. Here’s a quick overview of how it works:

    Initialization

    Tentacle Pool: At game start, I initialize a pool of tentacle instances to manage resources efficiently.

    Adding Tentacles

    Player Input: Tentacles attach to surfaces based on player input direction using raycasting.

    Random Positioning: The raycast direction is slightly randomized to determine where the tentacle will attach, adding variability to the gameplay.

    Spring Joints: I use SpringJoint2D to create a physical connection between the player and the surface.

    Management

    Instance Management: Tentacle instances are managed in lists to ensure efficient reuse.

    Periodic Checks: I periodically check and remove unnecessary spring joints to maintain performance.

    Creating Realistic Tentacles with the Line Renderer

    With the mechanics of movement taken care of above, this is how I made them look more fluid and realistic.

    I used the LineRenderer component to create realistic-looking tentacles. Here’s a quick overview of how it works:

    Tentacle Movement

    Segment Positions: The tentacle is divided into multiple segments. Each segment’s position is calculated and updated in the Update method.

    Smooth Movement: I use SmoothDamp to smoothly transition each segment towards its target position, creating fluid motion.

    Linear Interpolation: The amount of linear interpolation is adjusted based on the segment’s position within the line renderer, allowing for more than a simple mouse trail effect.

    Initial State: The initial positions of the tentacle segments are set in a spiral pattern, adding a natural look to the tentacle.

    These mechanics allow me to create fluid, realistic tentacles that enhance the player’s experience and interaction with the game environment.

  • Hello world!

    Welcome to WordPress. This is your first post. Edit or delete it, then start writing!