playMaker

Author Topic: Placing Objects into enviroment - Is my game achieveable in gamemaker?  (Read 3106 times)

Der_Kevin

  • Playmaker Newbie
  • *
  • Posts: 4
Hey guys!

So, its been now half a year since i have started with unity and starting to learn some c#.

In my "real life" iam a graphic artist and after 6 months of trying to get my head into the c# stuff i have to admit that this does not work out for me. maybe iam too stupid or my brain isnt made for programing. who knows :)

so now i explored playmaker.. horay! ;) so i just saw some youtube videos and stuff like that and i think its realy great! and now i want to srart to rewrite my game with the playmaker extension. at the moment it looks like this:



at the moment its just running around and placing some objects. but thats the part where I dont know if playmaker is the right choice for me cause i dont want to buy something just to recognize that it is useless for me.

you can find here a working example of what i have done so far with c#
https://dl.dropboxusercontent.com/u/52617394/webplayer.html

its verry messy coded and have a lot of errors. for example it should be not possibile to spin around or walk while you place an object, the camera is weirdly shaking while you are running and so on. you see, iam not the greatest dev in the world and this little "thing" already pushes me to the edge of my skills ;)

lets move  on to my question. I watched tons of playmaker tutorial videos and read a lot in the forum but i am not sure if this object placing stuff would be possibile in playmaker. i have no idea how i should raycast the object to my mouse and using different shaders when the object is placeable (transparent) or not (red).

so i just want to know if this would be possibile in playmaker or not and (if you would be so kind) you maybe could explain me how to do that :)

thats all :)
Kev

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Placing Objects into enviroment - Is my game achieveable in gamemaker?
« Reply #1 on: September 10, 2013, 01:24:18 AM »
Hi,

 Nice graphics!

-- What solution are you currently using to place objects? you seem to say you don't know how to do it, but it works in your example

-- Camera work. Do you want some camera movement at all or just a camera that follows at constant height?

In theory, ANYTHING is possible with PlayMaker. in practice, it still requires you  to understand the concepts, so wether you do them in c# or PlayMaker, grasping the logic behind what you want to achieve is important. PlayMaker will help you realize that better of course, but complex behavior will require some thinking, trials and error, so don't give up!

 Also, don't hesitate to make threads on particular questions, this will help searching and referencing for others to benefit from your learning experience.

 Bye,

 Jean

Der_Kevin

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Placing Objects into enviroment - Is my game achieveable in gamemaker?
« Reply #2 on: September 10, 2013, 05:35:39 AM »
Hey, thanks for your answer :)

-- its just a combination of raycasting and vector3 for the mouse position. and then some Collision detection to make the object not put into each other

the base code is

Code: [Select]
void Update () {
//Screen.showCursor = false;

if (currentBuilding != null && checkCollision.isMoving){
RaycastHit hit = new RaycastHit();
  Ray ray = camera.ScreenPointToRay (Input.mousePosition);
Physics.Raycast(ray,out hit, Mathf.Infinity, groundMask);



Vector3 m = Input.mousePosition;
m = new Vector3(m.x,m.y,transform.position.y);
Vector3 p = camera.ScreenToWorldPoint(m);

currentBuilding.position = hit.point;

if (Input.GetMouseButtonDown(0)) {
if(!checkCollision.isColliding){
checkCollision.isMoving=false;
checkCollision.collider.isTrigger=false;
checkCollision.gameObject.renderer.material.shader=Shader.Find("Diffuse");
checkCollision.gameObject.renderer.material.color=checkCollision.startColor;
currentBuilding=null;
}
}

}

so, not that much :)
its working in the example, but i want to "rewrite" it in playmaker

-- just a camera that follows at a constant height with some rotation dampening so that the camera flow feels more organic

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Placing Objects into enviroment - Is my game achieveable in gamemaker?
« Reply #3 on: September 11, 2013, 03:27:38 AM »
Hi,

 Difficult to say because more important code need to be studied in other places.

 Right now, I think you need to cut down the problem in smaller chunk.

1: can you spawn objects and move them on the surface ( no collision or effects)
2: can you apply shader effects
3: can you detect triggers on moving objects and react to them

When these 3 points are mastered, then you can put them all together to form your feature.

 Keep us updated on your progress, and don't hesitate to ask more granular questions on each points I made above. Look up this forum, there is a lot of example on object dragging and such.


Bye,

 Jean