Jump to content
  • Advertisement

Wayne Allen

Member
  • Content Count

    13
  • Joined

  • Last visited

Community Reputation

4 Neutral

About Wayne Allen

  • Rank
    Member

Personal Information

  • Interests
    Art
    Business
    Design
    DevOps
    Production
    Programming
    QA

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Wayne Allen

    best way to make this simple game idea in unity?

    Ok so I have added the moment script and the script for the chain thanks to Scouting Ninja, however, there seems to be a slight judder movement doesn't feel very smooth does anyone have any idea what could cause this? I'm moving the camera using a constant force component? (the red ball seems to move smoothly but everything else doesn't)
  2. Wayne Allen

    moving an object in C#

    Ok, so the final code for the movement is... using System.Collections; using System.Collections.Generic; using UnityEngine; public class upDownMovement : MonoBehaviour { public Rigidbody devilRB; private float resetPos; // Use this for initialization void Start () { StartCoroutine(TimedMovement()); } private IEnumerator TimedMovement() { // Wait yield return new WaitForSeconds(3); // Get the screen height and store in randomHeight float float randomHeight = Random.Range(-Screen.height, Screen.height); // Restrict up and down to keep in camera view if (randomHeight > 210) // Max up force { randomHeight = 210; } if (randomHeight < -210) // Max down force { randomHeight = -210; } // Setting the reset force if (randomHeight < 1) { Debug.Log("Going Down"); resetPos = (Mathf.Abs(+randomHeight)); } if (randomHeight > 0) { Debug.Log("Going Up"); resetPos = -randomHeight; } // Debug logs to view applied forces Debug.Log("force to apply: "+randomHeight); Debug.Log("reverse force: "+resetPos); // Applying the up and down force to regidbody devilRB.AddForce(000, randomHeight, 000); // Call to reset the force applied. StartCoroutine(TimedReset()); } // Resetting timer to put rigidbody back to starting position private IEnumerator TimedReset() { // Wait yield return new WaitForSeconds(3); // Apply the reset force to the regidbody devilRB.AddForce(000, resetPos, 000); // Restart the process StartCoroutine(TimedMovement()); } } I have added a max up/down force to add padding for the screen margins. I am probably certain this is not the best approach but it does seem to work. I have added a constant force component to the rigid body so it always goes forward as well. Would anyone else do anything different?
  3. Wayne Allen

    moving an object in C#

    Ok so after some digging in unity API, I think this is working now that I have changed this section: if (randomHeight < 1) { Debug.Log("Going Down"); resetPos = (Mathf.Abs(+randomHeight)); } if (randomHeight > 0) { Debug.Log("Going Up"); resetPos = -randomHeight; } I think the problem was Mathf.Sign should have been Maths.Abs
  4. Wayne Allen

    Noobie in need of guidence

    I have played around in Maya and Blender I feel relatively confident I should be able to make the assets I need for the game (fingers crossed) to be honest I do feel like I am hitting walls early on, I'm just hoping that will change after I get the hang of using unity.
  5. Wayne Allen

    moving an object in C#

    Ok so I am trying to apply a random up / down and force to a rigid body, and after the force is applied after x seconds it reset back to the middle. This is the code I wrote but the rigid body does not stay in the screen max height IE; if up or down force gets applied in a row it will go off camera. I hope I'm explaining this enough. Below are my 1st attempt and I am curious how far off am I? should I just give up on the game dev dream lol. the picture is for visual reference only not actual graphics public class upDownMovement : MonoBehaviour { public Rigidbody devilRB; private float resetPos; void Start () { StartCoroutine(TimedMovement()); } private IEnumerator TimedMovement() { yield return new WaitForSeconds(3); float randomHeight = Random.Range(-Screen.height, Screen.height); if (randomHeight < 1) { Debug.Log("Going Down"); resetPos = (Mathf.Sign(randomHeight)); } if (randomHeight > 0) { Debug.Log("Going Up"); resetPos = (Mathf.Sign(-randomHeight)); } Debug.Log("force to applie: "+randomHeight); Debug.Log("reverse force: "+resetPos); devilRB.AddForce(000, randomHeight, 000); StartCoroutine(TimedReset()); } private IEnumerator TimedReset() { yield return new WaitForSeconds(3); devilRB.AddForce(000, resetPos, 000); StartCoroutine(TimedMovement()); } } I really didn't think I would run into so many coding issues as I have PHP / action script under my belt 😢
  6. Wayne Allen

    Noobie in need of guidence

    Thanks, Steve my 1st game wasn't amazing, however, I feel like I have learnt a lot since making it. Problems I found is making it in flash and porting it to the apple/android store was not a good place to start. I wanted to make a very simple game mechanic where the goal was you just have to keep your finger on the devil while it moves and shows animation to distract the player to remove their finger, IE clips of spiders falling, clowns and fake incoming calls pretty much anything to make the player let go of the devil. I want to keep the theme but make it more interesting by having 2 circles where the devil drags your soul constantly to the right with random up and down pulling force and the distance gets longer over time and the camera zooms out. The player will be able to drag the soul circle up and down to collect things to shorten the distance and I would like to have enemies spawn and fly in from the right to try and break the chain. I am trying to do it in a 3d world as I think I might have more options this way with a fixed side view camera following the soul and devil circle. Here are some pictures of my 1st game.
  7. Wayne Allen

    best way to make this simple game idea in unity?

    wow, overwhelmed by your support, will boot up unity and start playing around with your code and see if I can understand it a bit better while testing. Your method is probably best as I want the chain to increase over time so the distance gets longer and the camera pans out and you have to collect items to reduce the distance, this shouldn't be too hard to implement as the connection is done through C#. still working out the game mechanics, like being able to move the yellow ball up and down to collect items (maybe draggable), and if you let go of the circle you lose. I seem to be a long way off of spawning enemies and shooting mechanics, however, I think you have definitely pointed me in the right direction thanks a lot!
  8. Wayne Allen

    best way to make this simple game idea in unity?

    wow, that's quite intimidating especially as maths is not my strong point and I'm a noob. Below is an example of the code I have made it feels like it is getting closer to what I am trying to do? using System.Collections; using System.Collections.Generic; using UnityEngine; public class Movement : MonoBehaviour { public Rigidbody devilBody; public Rigidbody soulBody; public float ySpeed = 30f; public float xSpeed = 10000f; // Use this for initialization void Start () { StartCoroutine(timedMovement()); } IEnumerator timedMovement() { yield return new WaitForSeconds(2); float randomHeight = Random.Range(-Screen.height, Screen.height); Debug.Log(randomHeight); devilBody.AddForce(100, randomHeight, 000); // soulBody.AddForce(-10, 000, 000); StartCoroutine(timedMovement()); } // Update is called once per frame void FixedUpdate () { } }
  9. Wayne Allen

    best way to make this simple game idea in unity?

    Thanks again Rutin, it's not so much the joint I have a problem with I get weird effects happening like gravity makes both balls drop even when I select do not use gravity. I want the gravity on the yellow ball but not the red, the only way I have been able to do this is by making the red ball kinetic however it doesn't seem to move when I add force in C# I kind of got it to work a little but it looked like the red ball was stationary I'm sure this is to do with the way the camera follows the red ball. Plus I don't think it helps where I am a noob I am not sure when is best practice to apply the code for example on Update FixedUpdate etc... what engine do you use?
  10. Wayne Allen

    Noobie in need of guidence

    Thanks, I will join the group I have also just posted my 1st question on this forum regarding the issues I'm having trying to make my game idea in unity. I'm sure I will get there, in the end, it's just a matter of me getting a couple games under my belt After a lot of research, I have decided unity and C# are the way forward I had a look in unreal and really like the editor, however, it seems a bit overkill for simple mobile games I'm trying to make.
  11. I am trying to make a game in unity and I am unsure of the best way to get the game mechanics to work. I want to make a game where 2 circles are the main characters for testing purpose lets say 1 is red and the other is yellow and they are connected by a chain (hinge or spring joint) and the red ball always travels to the right of the screen dragging the yellow ball behind the red ball will also go up and down randomly which in effect will pull and change the direction of the yellow ball. I want them to have gravity but also float? kind of like the red ball is flying and the yellow one is being kept up by the force of the red ball moving forward. I have included a picture to give some idea of what I am talking about. p.s, not the final graphics just marker images while testing. Any help would be great I am also undecided if I want the unity project to be in 2d or 3d with a fixed sideways camera. I am sure I will run into more issues down the road but for now, I can't seem to get the results I want from the start 😕 I have tried both balls with Rigidbodies and I have tried different ways to Add force to the RB with scripting but nothing turns out right?
  12. Wayne Allen

    Noobie in need of guidence

    Thanks for the reply, I completely agree it is easy to get carried away with grand ideas of big games etc. I did make a game once a couple of years ago for the play store using flash/action script with adobe air. I have been watching alot of tutorials on unity and am able to follow along without any problems, C# seems to feel pretty natural which is always a good thing. I have a simple idea for my 1st game but I must admit the game mechanics are giving me a hard time. I am trying to program 2 circles that are connected var spring or hinge joint and the 1st circle will pull the secound circle, however I am getting mixed results with none of them what I wanted -_-'. The game is meant to be simple but there is no tutorials I have found that I can use to help.
  13. Wayne Allen

    Noobie in need of guidence

    Hi, everyone I am a noobie on the game dev scene. Im looking for some help / advise. I have been making websites for years (php & mysql), however game development has always interested me. I am completely new to the community I have no friends or people that can help me along my game making path. Me and my wife are raising 5 kids and I have never meet anyone who is geeky like me maybe due to my geographical location (SE London). I dont usually join forums or anything like this I just thought I would give it a go and see if I can make some new friends.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!