Search Unity

Can somebody write me a c# camera script, please?

Discussion in 'Scripting' started by karaokefreak, Feb 28, 2018.

Thread Status:
Not open for further replies.
  1. karaokefreak

    karaokefreak

    Joined:
    Nov 12, 2013
    Posts:
    96
    Hi everybody.
    I am desperate for some code, and while I can't write it myself, I think it is easy for an experienced C# coder. I'd be a happy camper if someone took the time for this.

    This is what I need:

    Main Purpose: This script is to be attached to one of the cameras. It will define a "home spot" for the camera and a number of places for the camera to travel to, all within the coordinates of a superior Empty object ( so no world space coordinates). I will create gui buttons in the canvas which will activate the camera movement to one of these coordinates / view angles. In secondary function, the script is supposed to start the animation of one or more objects.


    What I need - in detail

    Camera Home Position: A set of public values --> Position X, Y, Z, Rotation X, Y, Z inside a superior empty object. The camera is to remain there if not told otherwise. When told through a Gui button, the camera will return to this home position.

    An array with a flexible number of Travel-Destinations
    Each destination is defined by public values for position X, Y , Z and rotation X, Y, Z
    Each destination must be accessable through a gui Button command (I will do the gui stuff myself, but the functions must be there)
    (Alternative solution: An Array with public entries for empty-objects, which define the destination of the camera.)

    A speed value for the camera movement to the destinations
    The camera shouldn't just pop up at the desired place, but move there in a speed with a public value. It would be great if the start and the end of the movement were soft.

    A public array, where I can start object animations.
    An animation start is supposed to be linked to a camera destination.

    So
    Object 1's animation No.1 is linked to camera destination No 1,
    Object 2's animation No 1 is linked to camera destination 2... and so on.
    However, activating an animation should be an optional feature - not every camera movement triggers an animation.

    Important: Moving the camera back home should always trigger the animation No.2 of the last animated object (which will practically be the same as animation 1, just backwards to the original still phase... but that is my task)



    I hope this is not too much to ask for... Thanks in advance.
     
  2. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    I stopped reading after the first bit..

    There are a lot of helpful learning materials on the site and elsewhere online. You can visit the asset store or unity connect if you'd like to purchase an asset, maybe get a free one, or hire someone. :)

    If you take the route of learning to create your own code, and get stuck with an issue, feel free to post here and ask for some assistance on the matter.

    Good luck! :)
     
    TheHighGround and Kurt-Dekker like this.
  3. My advice is to post on Unity Connect as a task: https://connect.unity.com/jobs/0/new/?type=task (if you're willing to pay for it, you would find people to write it for you, I'm sure).
     
  4. karaokefreak

    karaokefreak

    Joined:
    Nov 12, 2013
    Posts:
    96
    While I appreciate what you are trying to do, I really can't take this advice seriously. A year or two of learning C# is not a solution for a problem that needs fixing right now. Thanks anyway.


    Yeah, I guess I will do that, thanks for the advice :)
     
  5. duisti

    duisti

    Joined:
    Nov 29, 2017
    Posts:
    52
  6. DominoM

    DominoM

    Joined:
    Nov 24, 2016
    Posts:
    460
    It's not implemented how you described, but why not use Cinemachine, and create a script to check camera position and trigger an object animation when in place? I think that'll fit the functional requirements without needing much coding.
     
    Last edited: Feb 28, 2018
  7. fire7side

    fire7side

    Joined:
    Oct 15, 2012
    Posts:
    1,819
    Tomorrow there will be another problem and another. My advice to you is to stop writing games altogether since that's not what you want to do.
     
    TheHighGround, Ryiah, Kiwasi and 4 others like this.
  8. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    I agree 100%. If you're not willing to put the time in or don't enjoy it, just stop now otherwise its going to be an overly difficult journey ahead.
     
  9. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,977

    If that is your attitude, I would not make games then.

    There isnt really a "I want to make games but not learn all the hard work and put the time in" option. And you certainly wont get help from hardworking developers on here who do spend a lot of time bettering themselves and learning this hard stuff.

    We all started where you are.

    EDIT: either that or purchase an asset. Know that doing so will decrease the "unique" feel of your program potentially.
     
    firejerm and TaleOf4Gamers like this.
  10. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,531
    Methos5k suggested the same thing that LurkingNinjaDev did.

    Actually he suggested the same and more. Unity Connect, as well as the asset store, as well as doing it yourself and asking questions here.

    This forum is not for code begging though.

    So yeah, don't come here asking for someone to write code for you.

    That is unless you want to compensate us for it (in which case Unity Connect is the preferred place to hire people).
     
  11. Hey, don't forget, not everyone is a coder. OP asked a question, we answered what we think is best in the situation. Maybe the poster is a designer or an artist. Not knowing code is not bad. It's a state. And if (s)he needs some code, (s)he will get someone who does. It's not a big deal. Maybe eventually, while (s)he is working with developers (s)he picks up some coding skills as well.

    But please, don't tell anyone to give up. This is just super-impolite.
     
    TaleOf4Gamers and DominoM like this.
  12. TaleOf4Gamers

    TaleOf4Gamers

    Joined:
    Nov 15, 2013
    Posts:
    825
    Honestly, I didn't even think of that at first. :oops:

    It really doesn't help though when someone comes in with a laundry list of features that they would like someone else to create. It would be much preferred if someone simply asked for a base script which they could then go and extend by themselves. Especially for something like a camera which can vary quite wildly from game to game.
     
  13. Well, as I said, not everyone is a coder, so not everyone has the same analytical thinking as well. And even if (s)he is a coder, and it was just a try for the free ride, does not matter. Everyone has the right to ask stuff for free, the worst case scenario should be deny the request IMHO.
    And it's not bad that the poster tried, there is a chance that someone has a ton of free time and try to implement it for her/him.
    (S)He didn't demand anything, (s)he asked. And what listed here is actually a fairly good description what is needed, which is more then some developer can write down about a task. ;)
    So don't go hostile on her/him, (s)he does not deserve it this time.
     
    TaleOf4Gamers likes this.
  14. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    No, we would rather try and promote people to contribute rather than beg. He can learn how to code if he needs it or hire someone. It's better to post what he's tried, and attempt to get it fixed. We all had to start somewhere.
     
  15. Yes, that's why I sent her/him to the Unity Connect. I usually try to help iron out code if the OP tries to do something and post her/his result code in the forum, so we aren't in any opposition here and also we're beating the dead horse here.
     
  16. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Thread gave me a good laugh. The only thing it is missing is an offer for revenue share.

    As already mentioned, the forum is a great place to come when you have tried your best but your code isn't quite working right and you don't know why. You'd then post your code and explain what you're trying to do, and what your code is doing instead of what you wanted. Usually someone will come along and give a few tips, or even rewrite a small section.

    If you have an extremely simple request, like how can I write a function to do X? Something that would be under 10 or so lines of code, often someone will still help with that.

    Writing a page long laundry list of features, where you're expecting someone to just write everything for you to spec for free, with possibly hundreds of lines of code (didn't read your whole thing, but when you fill over an entire page with your feature requests, I have to assume), is just being ridiculous. That and you've been a member here for 5 years. Usually this stuff comes from someone who just created their account. Again good laugh. :)
     
  17. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,147
    From the way the description reads you're after a cutscene solution.

    https://www.assetstore.unity3d.com/en/#!/content/65397
     
  18. karaokefreak

    karaokefreak

    Joined:
    Nov 12, 2013
    Posts:
    96
    Funny, how many people have set opinions here, without actually knowing me. I am a 3D Artist and I have a real job as well. I think for my leisure time it's more than enough for my part to do 3D graphics, textures and overall game design.
    Unity is an Engine for beginners. A lot of things work out of the box without coding. And if it didn't, I'd go over to Unreal Engine 4, since there is no coding required at all. Coding is just not my thing.

    I find the elitist attitude here really peculiar. If somebody asked me to design a simple 3D mesh for his game, I might just do it to help him out - given that i have the time. Some people in these forums however, have more fun discouraging and belittling people. Oh what a fine community ;)

    BTW: I got someone in Unity connect to write the code that I need, so the case is solved.
    PS: I am a guy XD
     
  19. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,531
    Well to be fair.

    The opinion is regardless of you.

    You could be the pope, they'd probably have the same opinion about code requests.

    I mean that'd be like saying "Funny how so many people have opinions about my not using my blinker when driving, you don't even know me." Nope, they just don't like it when people don't use blinkers, or in this case, do what is often called "code beg".
     
  20. karaokefreak

    karaokefreak

    Joined:
    Nov 12, 2013
    Posts:
    96
    What you write makes it even worse. So it's not for my person, no, you generally are too elitist to help people out with simple things. You expect everyone to learn coding. Well, what if you didn't have an asset store to buy models and such? Could I expect from you to learn 3D-Modelling first? Geez, I thought this is a community here.

    I asked for help. I never demanded anything, and actually, this is a mini script, written in 15 minutes (the guy who wrote it actually did it in about five minutes). What the fuzz, dudes? It's not like I asked you for a magnum opus.-
     
    Last edited: Mar 1, 2018
  21. fire7side

    fire7side

    Joined:
    Oct 15, 2012
    Posts:
    1,819
    I've done some models for people for free because it was a free project. All I was saying is this problem is going to keep coming up and eventually people will get tired of writing scripts for you unless you pay them. It gets expensive, and knowing the basics when you are designing means your designs conform more to the reality of programming. You may be able to partner with a programmer and do a project, that works sometimes.
    It doesn't take a year and a half to know the basics. There are some simple tutorials in the learn section that you can go through in a matter of days or weeks and you will be able to do simple programming. Know what to ask. Know what you are getting into for your own designs. People here will be glad to help you work out a problem you are having. You'll see a completely different side to it. Nobody likes somebody saying, do it for me for free. That's not what this forum was designed for, and it happens pretty often. Maybe you have some art skills, but usually it's just a lazy kid. The worst is, someone gets suckered into it, and then a week later they are back with another script that needs writing for them and we all suffer going through those useless threads.
     
    Last edited: Mar 1, 2018
    lordofduct likes this.
  22. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,147
    I understand where you are trying to go with the comparison of a simple mesh to the script you requested but the reality is that someone who has no coding experience can't make a fair comparison. What you see as a relatively simple task may not at all be a simple task to someone else and vice versa.

    Exactly. We don't know you. You've been here for years yet you have comparatively very little activity. Since you have very few posts it wasn't difficult at all to quick glance through their summaries to get a grasp of your activity and do you know what stood out to me the most? You've never assisted anyone.

    We have threads constantly appearing in sections that are definitely within your grasp and yet you've never taken the time from your schedule to answer even the most basic questions available. You've made the statement that you would be willing to assist people with their game but five years of posting history give a completely different story.
     
    MitchStan, elmar1028 and lordofduct like this.
  23. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Let's recap what we know about you:

    >You're begging for code.
    >Calling the community elitist for expecting you to learn what everyone else had to.
    >Have been here years yet have contributed very little.
    >Threatening the dreaded "I could switch to Unreal.", oh no, you might use another engine.

    You have all the exact attributes that people who do this kind of thing don't like. We all had to do the slog to learn it, and now someone we don't know is expecting it for free. That's why you're getting this kind of feedback.
     
    Last edited: Mar 1, 2018
  24. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,531
    LOL...

    First off, my post was not really at you, but rather to defend @methos5k for offering up multiple solutions to your problem which you ignored. Yet you also thanked another poster for offering only one of those solutions (not criticizing lurkingninjadev mind you).

    Furthermore,

    I have been here 7 years. I have over 5000 posts. Yet I've only created 35 threads, most of which were not even to ask for help. Where as you have been here 5 years, have 78 posts, all of which were to ask for assistance.

    Ask anyone here, I LOVE to help. I spend every day here answering questions.

    I just have one rule.

    If I'm going to put in the effort to assist someone, they need to put in the effort to get that assistance.

    See... I went to college to be a math teacher. Since middle school I've been a tutor of math. I remember one day I was helping my little sister with her homework and she got all upset that I didn't just do the work for her. She cried to her mother (my step mother) and I waited in anticipation for her mother to explain to her the importance of doing something herself. What happened instead...

    "Honey, don't worry, you'll marry a successful man... Lordofduct, you know she struggles with this stuff, just do it for her!"

    . . .

    Nope.

    I don't play that game for my own little sister.

    I certainly ain't playing it for you.
     
    Last edited: Mar 1, 2018
    Ryiah, MitchStan and boxhallowed like this.
  25. karaokefreak

    karaokefreak

    Joined:
    Nov 12, 2013
    Posts:
    96
    Guys. I help out a lot. Just not necessarily in these forums, since nobody approached me in what I can actually do. However, I have had lots of contact to other people in these forums, and I made a LOT of free 3D and 2D graphics for other people. Ive helped people beta testing and debugging their assets as well.

    You don't know jack and judge me by forum post numbers. It's a shame actually, and just another facette of your elitist thinking. I AM ready to pay people for their work, by the way, and guess what... a volunteer would have got some reward.

    But since you've all checked my forum history here, I am sure you caught my forum post from a few years ago where I asked for help vs pay and the community told me that nobody works for money here and coders wouldn't answer semiprofessional tasks, so I should just ask nicely. Make up your minds, please.

    It doesn't change a thing. You cannot expect everyone to learn coding. Some people just have no talent or patience for it, just like some people aren't talented in making 3D Graphics. If that disturbs you, well then just don't read these posts. It is your free choice not to help. But what you do here is absolutely counterproductive.

    And on the subject of "how much worth is a piece of code". I think I made clear that I understand the basic nature of a script and what it can do, otherwise it wouldn't be such a Laundry list, right? I have released two cell phone games without somebody writing a single additional piece of code. Sometimes I just copy and edit example code. So I actually do know about how much time it takes - aside from the fact that I know professional c# programmers who laugh about the little effort programming for unity brings up, compared to real programming tasks in professional web and business design. If unity didn't have this whole bunch of restrictions and outdated support, which makes all kinds of .NET functions unavailable, I'd have my code written by those friends.

    So that is a no, you are wrong. I know how much effort comes with a simple piece of code in the fashion of the one I asked for. It's absolutely simple basic stuff, and still you make the big riot here. Yeah, I can't do it, but that is no reason to belittle me. I have other talents. But good to know which attitude some guys have. It's not constructive what you do, because this way, you will get nobody to learn coding. You will just scare people off. This incident alone makes me think about changing over to Unreal Engine 4, where people actually help each other with much more complicated c++ code, even if there is no coding required due to the blue print system.
     
  26. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    - A "simple piece of code" you refuse to learn.
    - "aside from the fact that I know professional c# programmers who laugh about the little effort programming for unity brings up, compared to real programming tasks" Then you belittle the programmers on the forum, while at the same time, once again saying how easy it is while not knowing how to do so.
    - "It's absolutely simple basic stuff" Then learn to do it instead of begging.
    - Begging, then threatening to leave to another engine when the community doesn't respond well. "This incident alone makes me think about changing over to Unreal Engine 4"
    - "You cannot expect everyone to learn coding." If you don't want to pay for coding then yes, we do.

    You remind me of those friends who know you have a truck, and sucker you into coming over and helping them move without so much as a fiver for gas. Then when it comes time you need help, never is to be found. Please act a little more mature.

    We're here to help, but we don't foster begging threads, beginner MMO threads, and spoonfeeding because it creates a bad community. If you want to learn or have code that needs critiqued, and it shouldn't be too hard by your own admission, then we're here.

    Edit: I frequent the UE4 community as well, they don't foster this kind of thing either. It's just how programmers are.
     
    Ryiah and lordofduct like this.
  27. Wannabeuk

    Wannabeuk

    Joined:
    Feb 19, 2013
    Posts:
    62
    Yeah you will find us programmers have a HUUUUUGE ego and a bitter side. Also People like to vent no matter how polite because other demand in a much less polite way. Really all this needed was a reply suggesting your in the wrong forum. But it is what it is.
     
  28. lordofduct

    lordofduct

    Joined:
    Oct 3, 2011
    Posts:
    8,531
    I believe at this point the so called "riot" is in reaction to your indignation.
     
    Ryiah, MitchStan and boxhallowed like this.
  29. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    Exactly. Sometimes I will just pop out a piece of code if someone ask, but when someone acts like this. It isn't good for anyone. Calling the community elitist and simple after not getting what you want, is not the way to go about this place.
     
    Joe-Censored and Ryiah like this.
  30. zombiegorilla

    zombiegorilla

    Moderator

    Joined:
    May 8, 2012
    Posts:
    9,051
    Unity connect is the proper place for requests, not the forums.
    Closed.
     
Thread Status:
Not open for further replies.