Script to reflect object

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Script to reflect object

Post by Granamir »

Hi,
anyone knows if there is a way to reflect model of an object (ceiling) via script? (i know absolutely nothing about modelling, don't have a program, just need 1 reflection, so best way doing via script...or i'll look for some other solution)
Thank you
User avatar
THOM
Posts: 1280
Joined: Wed Nov 20, 2013 11:35 pm
Location: Germany - Cologne
Contact:

Re: Script to reflect object

Post by THOM »

Don't know what you mean by "reflecting"? Do you mean to have a mirrored image ob a model on the ceiling??
THOM formaly known as tschrage
_______________________________________________
My MOD (LoG1): Castle Ringfort Thread
My MOD (LoG2): Journey To Justice Thread | Download
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Script to reflect object

Post by minmay »

You can't. You can rotate models in their asset definiton, and you can translate/rotate/scale the entire GameObject setWorldRotation(), but there is no way to flip anything since that is a change in the actual geometry of the mesh; there's a reason "flip" is separated from rotation options in image/model editors. Try to mirror your keyboard around one axis IRL, it's impossible. You would have to make a separate, flipped version of the mesh.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: Script to reflect object

Post by Granamir »

I meant, flip. ^_^

I'll find another way around then.

Thank you.
Azel
Posts: 808
Joined: Thu Nov 06, 2014 10:40 pm

Re: Script to reflect object

Post by Azel »

Are you trying to have what is on the ceiling reflect from water? If so, you could just place a copy of the ceiling object inside the water, then show/hide it based on floor triggers. So, for example, when someone approaches the water there are floor triggers that create a copy of the ceiling object inside the water, and when someone jumps in the water there are other triggers that remove it (or the original floor triggers remove it OnDeactivate).

Probably a cheesy work around, but could be fun and easy way to achieve this :mrgreen:
Granamir
Posts: 202
Joined: Wed Jan 07, 2015 7:19 pm

Re: Script to reflect object

Post by Granamir »

Azel wrote:Are you trying to have what is on the ceiling reflect from water? If so, you could just place a copy of the ceiling object inside the water, then show/hide it based on floor triggers. So, for example, when someone approaches the water there are floor triggers that create a copy of the ceiling object inside the water, and when someone jumps in the water there are other triggers that remove it (or the original floor triggers remove it OnDeactivate).

Probably a cheesy work around, but could be fun and easy way to achieve this :mrgreen:
Thank you.
I'm creating a level using mine set but i need height of 4 tiles. Unfortunatelly is not possible with actual tile set so i had to us what i have. Now for exit that level i need a "hole" (with wall on top of it) and find some problems with models (that have a sharp cut) so i need to flip one to make 2 sides (of 2 models) match to make a round model.

...unfortunatelly, in the end, those 2 levels will have some graphic issue, i can't solve them...

btw thank everyone
Post Reply