playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - KozTheBoss

Pages: 1 [2]
16
PlayMaker Help / Line break in GUI TEXT? [SOLVED]
« on: April 12, 2013, 02:45:02 PM »
yet another problem that i have run into =( I've looked on the Unity forums, and it seems that \n should make a new line and \t is tab, but none of them work when i input text via playmaker :(

Is there any way to make a line break via playmaker?

17
PlayMaker Help / GUI Text disappears behind GUI TEXTURE
« on: April 11, 2013, 07:34:47 AM »
so i have a gui texture object and i have a gui TEXT object that i want displayed on TOP of the texture (basicly its like a tooltip when the player does a mouseover of an item in the game world.

The Texture is the backdrop window for the text, and the texture has actions that gets mouse position in world, converts it to a screen position and sets its own position to the screen position every frame so the texture follows the mouse and this works great!

The GUI Text is a child of the GUI texture and also has the follow mouse actions. this also works great, except the gui text appears behind the texture so i cant see the text

I know it has something to do with Z position, but it sets that automatically when it calculates screen position, and even though the text has a lower Z value than the texture, it still displays behind (lower Z's should display in front)

Any simple fix for this, or do i have to get all complicated and stuff?

Any help appriciated!

18
PlayMaker Help / GUI Texture dynamic placement?
« on: April 08, 2013, 03:33:57 AM »
Hey guys, so im working on my graduation project on my 2nd week right now, and im trying to have my GUI texture (used for my healthbar) always be at 20% of screen height from the bottom of the screen - is there any way to do that? right now i can only set its height and width indent in pixels from the edge of the screen, so when you play the game at a different resolution than in the editor window, the healthbar moves to a different location =(

help?

19
PlayMaker Help / Play Sound action volume cap? [SOLVED]
« on: March 29, 2013, 06:59:59 PM »
Hi guys! So i´ve started a new project which is now my 10-week graduation project

Im doing a "Diablo meets Xcom" style game, and im almost done with the main-menu functionality, the only problem i have, is that i have a play sound action in the menu in order to play the theme music - even though my PC audio is turned to max etc, and the "Volume" of the play sound action is at 1, the music is nowhere near the volume i want (i want it louder). It´s quite quiet compared to say, if i watch a normal youtube video on the pc etc. Is there no way to make the sound louder? I´ve tried setting the volume to 2 or even 10 but the volume stays the same as at 1. Turning it to 0.5 works, as it cuts the volume in half but.. I just want it louder =( any help?

-Koztheboss

20
PlayMaker Help / Change GUI TEXT color?
« on: January 10, 2013, 05:56:25 PM »
HAI GUISE!

still drilling away at the attempt of my top-down shooter - I've come to the point of almost polishing and getting the last vital bits and bobs in before i tag it as an alpha and put it on my portfolio for further development

So I have a shop where you can buy weapons and upgrades - however when a player tries to buy something and dont have enough money, there is currently no feedback to tell them that..

What im creating is text on the screen that will pop in & out saying "You can't afford that!" in red

I've come so far, but for the love of god I can't figure out how to change the texts color to red =(

I've tried assigning a red material to it, but as you probably know that just fucks up the font completely

I also need to figure out how to make the text fade out slowly (like transparancy) but none of the GUI actions seem to work on my GUI TEXT - nothing! =(

Any help is appriciated :)

Koztheboss

21
PlayMaker Help / [SOLVED] AI Health system
« on: January 05, 2013, 04:42:21 PM »
Hi! I realise that i have asked this before, but i never found any solution so here goes again (at least this is for a new project)

It's weird how it is with AI health systems - it seems that everyone are using them but i just cannot find ANYTHING about how to make them anywhere on the internet =/

That being said, what i need is a way to have an enemy prefab where i can spawn 10 of them and each one will have their own health

I've been trying to wrap my head around it for so long it's doing my head in!

I've tried using a global variable called enemyHealth that i then take away from when i shoot them but the problem with global vars is that All 10 of the prefabs that i spawned will use that variable and that means that they all share the same health pool..

How can i be smart about doing this? I had a look at targetPro, but as far as i can see it's only useful for things like turrets and other AI stuff

halp pls =(

-Koztheboss

22
PlayMaker Help / A* pathfinding with playmaker?
« on: January 03, 2013, 07:18:15 PM »
Hi again playmakers :)

I have just fiddled around with the A* free pathfinding and have managed to get an AI moving to a ceartain pre-defined set of coordinates while generating a path and avoiding obstacles on the way

However - What do i do if i want this AI to be an enemy character that chases the player? are there any tools in playmaker where i can make an AI move  while using the pathfinding data i have collected, or do i have to code the chasing alltogether?

This is what i have for the AI so far;

Code: [Select]
using UnityEngine;
using System.Collections;
using Pathfinding;

public class Movescript : MonoBehaviour {
  
    public Vector3 targetPosition;
    private Seeker seeker;
    private CharacterController controller;
 
    public Path path;
    
    public float speed = 100;
    
    public float nextWaypointDistance = 2;
 
    private int currentWaypoint = 0;
 
    public void Start () {
        seeker = GetComponent<Seeker>();
        controller = GetComponent<CharacterController>();
        
        seeker.StartPath (transform.position,targetPosition, OnPathComplete);
    }
    
    public void OnPathComplete (Path p) {
      
            if (!p.error) {
            path = p;
            currentWaypoint = 0;
        }
    }
 
    public void FixedUpdate () {
        if (path == null) {
            return;
        }
        
        if (currentWaypoint >= path.vectorPath.Length) {
            return;
        }
        
        Vector3 dir = (path.vectorPath[currentWaypoint]-transform.position).normalized;
        dir *= speed * Time.fixedDeltaTime;
        controller.SimpleMove (dir);
        
        if (Vector3.Distance (transform.position,path.vectorPath[currentWaypoint]) < nextWaypointDistance) {
            currentWaypoint++;
            return;
        }
    }
}

So basically what i understand of this is that it supplies the enemy AI with the target coordinates variable and it generates a path and moves along it to the target

but how would i go about making that variable a global var so i can change it every frame to update coords with the players position, and is that even possible?



in short, I want the enemy AI to chase the player and still avoid collisions, but what i have right now only works with a static coordinate that can't be changed

help please =(

--EDIT:

I now have the player saving his coordinates as a vector3 var and the pathfinder is now taking those coordinates as the travel destination - but again, it only does this once, and if i move it will just walk to the location where i started as a player and then stop there

I have tried changing the start function to an update function without any success

-sorry, im not the strongest in coding (which is why i'm here in the first place)

23
PlayMaker Help / Gun recoil / kickback
« on: November 28, 2012, 10:29:53 AM »
Hi guys! I've been messing around with gun recoil and have been trying to add rotation to my camera when the player fires a bullet, but can't seem to make it work - do you guys have any idea why it won't rotate? I read on the unity forum a guy suggesting to make a sandwich for the camera, but im not really sure what he's talking about

Sorry if this is a noob question, but im still quite new to playmaker, and the search bar came up with nothing =/

Thanks in advance - koztheboss

24
So I'm having a problem where all my enemies share the same health.

I have a prefab called zombie. When the game first launches a global variable called zombie_health is set to 100.

When a zombie spawns, and i shoot at it, the game will retract -25 from the zombie_health. When zombie_health reaches 0, the zombie will destroy itself

When i spawn more than one zombie, they obviously share this one variable and thus all have the same health and will all die when health reaches 0 - also, shooting any of the zombies will retract health from the variable, so i can have 4 zombies and shoot each of them once and they will all die

I have been messing around with possible solutions for a couple of hours but can't find one that works..

Any of you geniouses have any idea as to how i can spawn a zombie and assign to it a unique health bar, and track damage to that specific zombie?

Right now the tracker is a ray-cast from the bullet that saves object hit as a variable. It then compares the variable with the word "zombie", so it checks if target hit = zombie and if it is, it will do 25 damage to the zombie_health variable

Any help is greatly appriciated.

__________________________________________________________________________________________

A few hours later now, and i've tried giving the zombie prefab a local variable called "my health" and then when 10 zombies are in the game, the bullet would save "object hit" in a variable, which would then trigger an event to that specific zombie to fire it's event "take damage".. But I can't make a send event like that because i can't reference the specific zombie - the "target hit" variable doesn't work =(

There must be a smart solution for this - Am I just too narrow-minded to see it right now?

Any help appriciated - this is doing my head in =(

25
PlayMaker Help / Compare int is behaving weird [SOLVED]
« on: November 25, 2012, 06:57:09 AM »
so I'm making a prototype for a school project - so far i have the enemies chasing the player, and when they come close they retract 25 health from the health Int which is then updated with the new health, converted to a string and displayed as a GUI TEXT - all of that works fine, but i now have a listener that has a compare int action that compares the health int to 0, and if it is equal to or below 0 it will go to next state which destroys the player.

The weird part is that it doesn't work. Not just that, but if i set it to compare to 100 (what the player starts with) it works like a charm and instantly kills the player when the game starts. If i set it to 200 it also works (because starting value 100 <= 200)

If i set it to 75 it doesn't work - the health will just go to 75 and below and not kill the player, but if i switch compare from <= to >= it works again (because 100 starting value => 75)

Any ideas as to why it wont compare the int to 0 or 75 for that matter? seems like equals to or less than only works when i set it to more than the starting value of the player health :(

Pages: 1 [2]