Ghost Trick: Phantom Detective

Ghost Trick is an adventure game released for the Nintendo DS and later for iOS. In this game, the player uses the DS stylus to control the soul of the newly dead Sissel as he seeks out the mystery of his own death - and prevents several along the way.

If the game feels similar to games like Ace Attorney, that's intentional.