Jump to content

Using Animations for Laser Weapons


VR_Dev

Recommended Posts

Well now I feel dumb.

i95RQRj.png

I just re-exported the part in unity and now it works fine. The handle is inside the hinge a little but it looks fine to me. Almost like the hand is gripping it. I wish it were more cone like instead of just a line, but thats being super picky. Thanks to everyone who gave ideas.

Time to work on the damage, whoever suggested the fx at the point of contact is a genius, that would be the coolest thing ever.

Edit: It was nil2work, he suggested a raycast from the grip, so time to look into that

Edit 2: Updated part and source https://www.sendspace.com/file/cosij4

Edited by clown_baby
Link to comment
Share on other sites

Ahh well - now I feel better haha

I thought I must be completely inept and gave up..

2 days wasted..

Line: true - a downside..

If you create a glowing transparent mesh, I will contribute the code to add this insted of a line..

if you also create a collider (or maybe a trigger, not sure right now, maybe both), the damage could probbably be made without raycast.

in short, your first plan was probbably the better solution - now that it's obviouse that the line sucks big time..

You mentioned help with custom parts..

I could indeed use some help with a space station..

I don't get the animations working and ground contact does not work either..

Since 3 days I try in every way, all tuts seem to be out dated because my unity behaves differently somehow

It's just not working and I suffer from acute Unity-confusion right now.

Do you have any experiance in those areas?

I don't mean curing my brain lol, I mean fixing my animations..

would be appreciated.

Link to comment
Share on other sites

Ahh well - now I feel better haha

I thought I must be completely inept and gave up..

2 days wasted..

Line: true - a downside..

If you create a glowing transparent mesh, I will contribute the code to add this insted of a line..

if you also create a collider (or maybe a trigger, not sure right now, maybe both), the damage could probbably be made without raycast.

in short, your first plan was probbably the better solution - now that it's obviouse that the line sucks big time..

You mentioned help with custom parts..

I could indeed use some help with a space station..

I don't get the animations working and ground contact does not work either..

Since 3 days I try in every way, all tuts seem to be out dated because my unity behaves differently somehow

It's just not working and I suffer from acute Unity-confusion right now.

Do you have any experiance in those areas?

I don't mean curing my brain lol, I mean fixing my animations..

would be appreciated.

I'm really sorry man, I could have sworn I had everything centered. Rookie mistake. A clear collider is a good idea. That would mean that it could damage things even if the sword is turned "off", but thats really not a big deal at all. And the line really isn't that bad, I'd be happy if that was the final product.

And for the glowing transparent mesh, could that be disappear when toggled off? I'm not sure.

As for your custom parts, I can for sure help you with animations and ground contact. I'll pm you. I've learned a ton in unity doing this.

http://forum.kerbalspaceprogram.com/threads/80808-Fully-Functional-Customizable-Zoids

Link to comment
Share on other sites

no problem - unity wasted allready monthes of my life lol

The mesh/collider/trigger..

yes, in my plan, all 3 would be added and removed when you toggle the sword..

so - also no damage when off..

I can use the positioning of the line - I just add an different object instead of the line - should be straight forward to have a mesh..

(once the mesh's position/rotation is correct lol)

the collider will give physical feedback so you can't move through solid stuff,

the trigger should afaik be able to tell me which parts it has touched - then I can damage them individually

If my current understanding of the task is working as planned, you can cut off limbs by destoying the shoulder part lol

Thank's for the help offer..

I'll explain the problem in a PM..

Link to comment
Share on other sites

A clear collider is a good idea. That would mean that it could damage things even if the sword is turned "off", but thats really not a big deal at all. And the line really isn't that bad, I'd be happy if that was the final product.

And for the glowing transparent mesh, could that be disappear when toggled off? I'm not sure.

It may be possible to make a translucent cone-shaped mesh for the blade of the Beam Saber with the collider already included in the same mesh. And while it's not possible to disable colliders, you can shrink them down so that they are no longer effective when not needed.

Link to comment
Share on other sites

Got it, here it turns off, then back on.

SillyAgonizingDromedary.gif

But man do I feel bad for wasting everyones time. It's so simple, I feel dumb for not thinking about this sooner. I added the cone in blender then added an animation to shrink it and move it inside the handle. I have to test it but I believe the collider associated with the beam should shrink as well.

If anyone still wants to pursue our original ideas as a proof of concept for the benefit of other's I'd be down. But this works for me.

Things that still need to be done:

It would be cool if it could glow, but not at the expense of it slowing the game way down.

And damage, hopefully now something can be written in the .cfg to make it damage things, or is a plugin still needed?

Blender save

GameData Part(Updated with the glowing one)

Edited by clown_baby
Link to comment
Share on other sites

Things that still need to be done:

It would be cool if it could glow, but not at the expense of it slowing the game way down.

At the very least, one could apply an emissive texture to make the Beam Saber blade light up, for negligible impact on performance. However, the glow from the blade won't illuminate nearby objects (for that, you would need a Spotlight or Point Light in Unity, which may cause performance issues depending on how many light sources you use).

Link to comment
Share on other sites

At the very least, one could apply an emissive texture to make the Beam Saber blade light up, for negligible impact on performance. However, the glow from the blade won't illuminate nearby objects (for that, you would need a Spotlight or Point Light in Unity, which may cause performance issues depending on how many light sources you use).

Awesome, thats exactly what I want to hear. I want it to glow without lighting up everything else. I've never used emissive textures before, I'll give it a shot

Link to comment
Share on other sites

MarvelousShabbyAtlasmoth.gif

Any ideas at all as how to get one mesh to inflict damage on another. Without damaging the handle mesh it also touches? I'm happy with the above product, I'm just curious.

I do still have to work on the beam shape/length

Link to comment
Share on other sites

http://fat.gfycat.com/MarvelousShabbyAtlasmoth.gif

Any ideas at all as how to get one mesh to inflict damage on another. Without damaging the handle mesh it also touches? I'm happy with the above product, I'm just curious.

I do still have to work on the beam shape/length

Looking good! you can also try tweaking the shader's opacity in Unity and nest multiple cylinders to get brighter core with fall-off look; for damage you can take a look at Romfarer's Sunbeam or Bahamuto's new Laser weapon for raycast, damage, and particle spawn stuff.

Link to comment
Share on other sites

Looking good! you can also try tweaking the shader's opacity in Unity and nest multiple cylinders to get brighter core with fall-off look; for damage you can take a look at Romfarer's Sunbeam or Bahamuto's new Laser weapon for raycast, damage, and particle spawn stuff.

Yeah thanks, I gotta play with it more, that was my first attempt at the emitter. I think it made my zoid head look super awesome though.

AihAdYF.png

thread

Link to comment
Share on other sites

>Any ideas at all as how to get one mesh to inflict damage on another. Without damaging the handle mesh it also touches? I'm happy with the above product, I'm just curious.

sure

if(this.part==that.part)

=> no damage

can you send me the current file?

As I said in my PM, if you set up one of those meshes as a trigger, I can see if I can detect what part it touches..

should be possible though - the functions are all present in the classes

however - if that works, the damage is merly copy paste from my other plugin..

same for particles.. straight forward...

But I need a trigger mesh with the same dimensions as your visible one to test this solution..

you can use the same mesh for this afaik..

..well - you know where to find me..

Link to comment
Share on other sites

Hey, the beam saber's shape (new and old) are kind of... not twords gundam.

Here is a actual gundam beam saber.

robot-spirits-extreme-gundam-type-leos-review-42.jpg

Take note that that is the Model version, the animated version is not much different, also, beamsabers can look alot like different modern swords. Like the katana.

Link to comment
Share on other sites

not twords gundam.

What does that mean? Like how he's holding it? Sorry I just kind of don't understand what you mean.

Also I could make it more narrow, and not as round, like a katana.

Link to comment
Share on other sites

http://www./download/jd27s6pria9el11/3swords.unitypackage

aS5dFjZ.jpg

:D didn't even think of it myself. :D

3 different ones. you can play with the Diffuse color and Rim fall off settings for more variations. import the package to your unity project, and grab one from the "Prefabs" folder and child it to your grip, adjust to your liking. Rim color and falloff is on all the KSP shaders, useful for something like these.

Edited by nli2work
Link to comment
Share on other sites

http://www./download/jd27s6pria9el11/3swords.unitypackage

aS5dFjZ.jpg

:D didn't even think of it myself. :D

3 different ones. you can play with the Diffuse color and Rim fall off settings for more variations. import the package to your unity project, and grab one from the "Prefabs" folder and child it to your grip, adjust to your liking. Rim color and falloff is on all the KSP shaders, useful for something like these.

Dude you are a pimp. I'll check em out whe i get home

Link to comment
Share on other sites

I've been jumping around projects, and I went camping over the weekend so I haven't gotten to try nil's different beams. But I did use the same concept to give my t-rex zoid a laser mouth canon.

I also learned how to have two animations in the same part, which is huge. THe mouth/tail opening, and the laser fire are two different animations. And the beam turning off if part of the animation, not me toggling it off.

JointCrazyFossa.gif

Link to comment
Share on other sites

  • 1 month later...

Works perfect. The collider disappears when the beam does. It just needs damage now. Shouldn't it be as easy as like

if{

beam mesh touches other part meshes}

then{

inflict x amount of damage on them}?

AshamedConfusedBlackfly.gif

Also it's hard to tell, but the beam isn't flat. It's a cylinder and cone that I flattened a little, it's still round. Unlike just line render

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 year later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...