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 - Martin-Vaupell

Pages: 1 [2]
Got a tank/turret setup.

The turret needs to be able to turn independently of the chassis, and it does.

the problem is, when i press 'W' to move forward(up) the model actually sorta moves of the direction i'm pressen, and certainly nowhere near the direction of the turret.

Any idea's why this is ? 

Screenshots below.

Green arrow indicates the expected direction, Red the actual.
It's as if the vector is being projected wrong.

PlayMaker Help / [SOLVED]Mouse pick - Store point - returns only 0,0,0
« on: January 14, 2014, 03:47:43 PM »
Trying to control rotation on a "turret" using Mouse pick and store point
But for some reason it only returns 0,0,0 

Anyone have any guidelines on setting this function up to return the vector3 of
the mousepointer  ?

Animations cause this character in the asset to move in depth,
also sometimes interacting with objects.

Trying to fix it using playMaker.

The idea was first i would constantly get Z, correct Z but it worked but was quite high CPU intensive ;)

So trying this way instead, But I'm getting a max 1000 loop warning.
and the character moves -Z until he falls off. 

He needs to stay on the Z depth of -0.5

Here is what i got in images first ;)

Overview of the issue  <-- large img. for small width forum.

getting the initial postion when the level starts

getting "current" position and comparing it with the start

Ajusting the depth of the player if its wrong

And he is "force" moved to his death

So any suggestions ;)


Trying to change the value of a component,
I have done so many times before, but not today.

Usually i would just "drag'n drop" the script/component right into Playmaker
and chose set, but not for this component.

I have marked on the screenshot what value im trying to modify,
and the left part of the screen shows the actual script.

Now I'm stuck so I'm thinking.

Is it even possible to edit this value with playMaker or should i setup a
entirely seperate system via playmaker to control the 3-4 items I'm going to
use throughout the project.


PlayMaker Help / [SOLVED] problems triggering a door (animation)
« on: January 05, 2014, 07:23:59 PM »
I've been following the tutorials on site, but i think some of them is outdated.
Gamedesign with playmaker the tutorial with the chest opening.

well i tryed to do the same thing, however Unity auto adds the "animator" script.
and playMaker requires the "animation" script.

See the screenshot

Now i can't get the animation to work until i add the runtime controller in the
animator, but then i need to go and set the states i the animator :(

I would prefer is i could just "play animation" as usual without using unitys animator.

I have allready tried
- removing the animator script which does nothing.
- adding the runtime controller which just makes the door open at scene start.
- tryed removing the animations script but then playmaker complains.

Any ideas how to make this work ?

PlayMaker Help / [SOLVED] C# global to playMaker global. How do i do it.
« on: January 01, 2014, 11:06:12 AM »
First off are the globals from playMaker able to "communicate" with the scripts?

I'm playing around with different assets and trying to "plug" into them
right now I'm trying to hook into "lockpicking and hacking" asset from the store.

By default the asset is supplied with this, and it where i think i would want to hook in.

Code: [Select]
/// <summary>
/// Resets the dial sequence.
/// </summary>
public void Reset ()
// Count the dial reset value
dialResetCount += dialSpeed * Time.deltaTime;

// Reset the entire sequence if we move too much in the opposite direction
if( dialResetCount >= dialReset * 3.6f )
while( sequenceIndex > 0 )

direction *= -1;

dialResetCount = 0;


I have been working with globals across multiple FSM in playMaker and is great.
now with that experience i want to simple via this script above change a
global variable, maybe a bool just doing a flip or an int, changing a value counting failed attempts.

And then I'm going to make playMaker detect the change.

My problem is, how would i add,set,change a global var inside that function in such a way playMaker or anything else can read that var?


made a Bool for testing purposes, called "dialFail" default = false.
Ok added this to the script..

using HutongGames.PlayMaker;  //  at the top
and trying to figure out the FsmVariables....
tryed a few things, and ofcourse changed the global type accordingly.

FsmVariables.GlobalVariables.BoolVariables("dialFail").....d.hmmm problems here..
I want to set or flip the bool value..

FsmVariables.GlobalVariables.   <---  SetInt ? ?  is that possible to set a
global int here.

private string mytext = "test";            FsmVariables.GlobalsComponent.ToString("dialFail").mytext;

PlayMaker Help / [SOLVED] disable mouselook ( like ingame options menu )
« on: December 30, 2013, 07:26:20 AM »
Scene/situation plan

FirstPersonPlayer walks up to a screen, Hits use and i get the popUp of the screen on the UI, player types something then clicks save, and walks away!


I'm using NGUI,Playmaker, NGUI scripts for PlayMaker.
FirstPerson controller from Unity standard assets.

What is working as intended
I walk up, get the 'press use button' and the pop up shows just fine,
when i cancel by walking away or exiting it closes just fine.


When the NGUI popup is active i want to disable "mouseLook" component in the player asset. Then enable normal mouse use.

And then ofcourse by cancelling disable mouse/re enable mouselook on the player.


If i where scripting this, i would maybe edit the player script itself to include something like this..
Code: [Select]
void Start ()
        noMouse = GetComponent<Mouse look>();
    void Update ()
            noMouse.enabled = !noMouse.enabled;

But then it could actually enable or disable when it should not,
so I'm trying to work this in from playMaker on the computer itself.

I was considering maybe use playmaker on the computer to set a globalVar and maybe add FSM to player just checking that globalvar constantly

The Computer

The Player component i want to change state on.


Well I'm not sure where to start to achieve this, so that's basically why I'm here.
Open to suggestions or better solutions to the same porblem.

;)  Vaupell

EDIT ADD : Just realized this is the same thing you would want to do
if you where to have a Ingame options menu.

ie. Hit esc/pause and being able to use the mouse there.


NOTICE : The game will most likely not be updated.
A lot has been learned in the process. However a sequel might be an option.

I set out to learn my way around Unity, already had a fair knowledge of C# when
i began meaning i was no stranger to the entire setup unity presented.

I started out by reading some of the guides and notices on the Unity forum,
and when it was installed i went through all the tutorials available,
some faster than others.

Fell In love with Unity and found a Indie dev guide stating it was important to get your first game out FAST! so i did.

So after a completing the "roll a ball" tutorial series i thought this could be a fun game. So i took my tutorial project and improved on it, wrote a GUI, better controls and added various things to it, made some scripts to control level start
and level ending, goals etc. This was all before i learned about the asset store.

Then by pure randomness i stumbled over a video on youtube from Unity where the Asset store manager Caitlyn spoke about it and understod this is a must
 place to checkout, so i went.

Within my first login to the store i have Bought 2 assets, 1 android controller and a Tile mapping tool.
Now i actually had all the parts to make the game, besides my prototype map.

I made 8 levels to begin with and was looking into how to control unlocks and level GUI, and went back to the store and actually got 2 GUI assets.

Now i had everything i Thought, and I proceeded to set the game up and liked
what i saw..

Then i Stumbled over "playMaker" (the game changer)
Each level took before several hours to make and debug, troubleshoot, and scripting.
Now i just concentrated on the design and use playMaker to control the scripts and game.

This game has been using playMaker from level 8 and forward, and now i Cant imagine myself doing another Unity game without playMaker!  <3 <3

******* The game ********

Game is a learning curve of my progress with Unity and the levels kinda
indicate what i have been studying while making the levels, example
level area 3+ is a lot about lights and lasers, because that is what I'm working
on now.

Warning - game is "small" ad supported (bottom middle)

Roll a ball,
lvls 1,1-1,7 push crates to goals to unlock the exit
lvls 1,7-2,9 various puzzle solving
lvls 3,1-> Stealth, lasors, etc ;)

Is out on Android and can be found here -


Thank you Hutong Games for playMaker!



PlayMaker Help / [SOLVED]RayCasting with playMaker
« on: December 23, 2013, 04:30:06 PM »

Get a stationary turret to turn with a red lasor (line renderer)
And rayCast detect for tag "player"

Model, lineRenderer, rotation is working as intended.

However, raycasting is not.


Raycasting should go from center of turret "from position 'none'"
and to the INVISIBLE gameObject which is rotating around with the lineRenderer
and that is what im getting positioning from in steps 1,2 on the image below.
But raycasting is not initiated, and or not working, not sure.

Image explanation.>

Center with playMaker logo is the turret iself, just a model.
from the turret to the right "redish" line is the lineRendere. <----- NOTE!
the LineRendere is the one where i have the "raycasting FSM on,
and that is what is shown on Image.


1 - get current frame position of invisible gameobject marking "end of lasor"
1a saving the coordinates as eolx,eoly,eolz
2 - converting the coordinates into vector3 named eol
3 - initiate raycast from "none" i would exspect that to be model center/joint
4 - get the coordinates from pkt 3 and sets the direction, ignoring distance for now.
5 - enabled debug mode, which should draw, but nothing is drawn.

BTW - Those boxes are in the layer "testRay" so it should detect them.



So guys,  What do you think may be my major mailfunction here ?

I'm now going to move the entire FSM onto the model instead of the
lineRenderer, but don't think that would / should make any difference.

Im up for trying anything, even crazy ideas just let me know ;)

Pages: 1 [2]